From the Tomcat5.5, the default settings will not be recorded in the application log, nor how to rest assured that the completion of the matter, today to help friends solve a problem with the intuition Daoteng a burst or not resolved, only to pick up this weapon, see the error log immediately after the fix, it seems the most humble indeed very important. This is helpful if you encounter the following conditions: 2007-7-6 13:27:13 org.apache.catalina.core.StandardContext start critical: Error Listenerstart
2007-7-6 13:27:13 org.apache.catalina.core.StandardContext Start
Severity: Context [/tsorm] startup failed due to previous errors nonsense, now start creating a new Log4j.properties file and copy the following content.
Log4j.rootlogger=info,console,r
Log4j.appender.console=org.apache.log4j.consoleappender
Log4j.appender.console.layout=org.apache.log4j.patternlayout
#log4j. appender.console.layout.conversionpattern=%d [%t]%-5p%c-%m%n
Log4j.appender.console.layout.conversionpattern=%d{yy-mm-dd HH:mm:ss}%5p%c{1}:%l-%m%n
Log4j.appender.r=org.apache.log4j.dailyrollingfileappender
Log4j.appender.r.file=${catalina.home}/logs/tomcat.log
Log4j.appender.r.layout=org.apache.log4j.patternlayout
Log4j.appender.r.layout.conversionpattern=%d{yyyy. Mm.dd HH:mm:ss}%5p%c{1} (%l):? %m%n
Log4j.logger.org.apache=info, R
Log4j.logger.org.apache.catalina.core.ContainerBase. [Catalina]. [Localhost]=debug, R
Log4j.logger.org.apache.catalina.core=info, R
Log4j.logger.org.apache.catalina.session=info, R
Then put the new log4j.properties in the%catalina_home%/common/classes directory, note that if%catalina_home%/common/ Lib directory without Log4j.jar and Commons-logging.jar, be sure to add in.
Another thing to remind is that the last 4 lines are the information set that the Tomcat log will record, so set on the development machine, it is best not set to debug on the running server, otherwise the server's space will be full soon, have encountered the log accounted for 8G, waterfall sweat.
Reprint: http://blog.sina.com.cn/s/blog_65f643db0100ljnc.html