WORKAROUND: Configure tomcat log get error message when encountering context [/tsorm] startup failed due to previous errors

Source: Internet
Author: User
Tags tomcat log4j
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.