TomcatExpert

How to change log level for Apache Tomcat

posted by SpringSource on October 27, 2009 03:14 PM

Changing log verbosity in Tomcat 4.1, 5.0 and 5.5

Tomcat 4.1
=========

In Tomcat 4.1, the logVerbosityLevel attribute for the Logger element can be used to set the log level. FATAL, ERROR, WARNING, INFORMATION, and DEBUG are the valid values. The default setting is at the WARNING level.

 

Tomcat 5.0
=========

In Tomcat 5.0, it can be changed through commons logging or log4j. Log4j is recommended as it has greater flexibility. In doing so:

1) Download commons-logging.jar

2) Download the log4j package

3) Copy both commons-logging.jar and log4j.jar to tomcat5.0/common/lib directory

4) Put log4j.properties file in tomcat5.0/common/classes

5) Add "lof4j.rootLogger=ERROR, ROOT" to the log4j.properties file which sets the global loglevel. NOTE: Skip this step if you only want to set the log level on the packages or classes level.

6) You can optionally set the loglevel for individual packages or classes. In this case, use "log4j.org.apache.jasper.servlet.JspServlet=ERROR".  ERROR, INFO, DEBUG are valid log levels for log4j.

 

Tomcat 5.5
=========

In Tomcat 5.5, the log level will be done through the individual Tomcat instance's logging.properties files. For complete documentation on how it works in Tomcat 5.5, see the official documentation provided by the Apache Software Foundation: http://tomcat.apache.org/tomcat-5.5-doc/logging.html

For more than 10 years, SpringSource employees have been supporting Apache technologies, with unparalleled experience and commitment to the Apache Software Foundation. More than 400 of the Fortune 500 count on SpringSource to support their mission-critical business applications. Leaders of the Apache Software Foundation, including Board Members, work at SpringSource and dedicate a significant amount of time further developing the Apache Tomcat open source project. Over the last 2 years, 95% of the issues fixed in the Apache Tomcat project were fixed by SpringSource engineers. For more information on how SpringSource can help your enterprise, see the SpringSource website, or call 800/444-1935.

Comments

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.