使用Crawler4j总结

下载demo跑起来之后出现:
Failed to load class “org.slf4j.impl.StaticLoggerBinder”.的错误。发现是maven配置少了log的框架。slf4j只是一个log的接口需要有log4j等的实现。顺便贴下log4j.properties的内容.

#log4j.rootLogger=debug,appender1,appender2
log4j.rootLogger=info,appender1,appender2
#log4j.rootLogger=error,appender1,appender2

log4j.appender.appender1=org.apache.log4j.ConsoleAppender
log4j.appender.appender1.layout=org.apache.log4j.TTCCLayout

log4j.appender.appender2=org.apache.log4j.FileAppender
log4j.appender.appender2.File=F:/Workspaces/SinaLogin/WebRoot/logger/logdemo.log
#log4j.appender.appender2.File=logger/Log4JDemo02.html
log4j.appender.appender2.layout=org.apache.log4j.TTCCLayout
#log4j.appender.appender2.layout=org.apache.log4j.HTMLLayout

你可能感兴趣的:(java学习)