运行的时候报关于log4j的警告!解决方案

阅读更多
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.


解决办法:

log4j.properties文件需要放到web-inf/class目录下面,在eclipse里面放到src目录下面,会自动拷贝到class目录下面去。

文件里面的内容如下即可:

log4j.rootLogger=WARN, Console

log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=(%r ms) [%t] %-5p: %c#%M %x: %m%n

log4j.logger.com.genuitec.eclipse.sqlexplorer=DEBUG
log4j.logger.org.apache=WARN
log4j.logger.org.hibernate=WARN


你可能感兴趣的:(log4j,Eclipse,Apache,Hibernate,Web)