log4j:WARN No appenders could be found for logger

Tomcat5.5.29在启动过程中报下列错误:

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文件,内容如下:

log4j.rootCategory=TRACE, CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

将文件拷贝到apache-tomcat-5.5.29的安装目录下的\common\classes下后,启动Tomcat的过程中不再报上述错误。

 

你可能感兴趣的:(职场,休闲,Tomcat应用)