Index: logging.xml =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/webapps/docs/logging.xml,v --- logging.xml 19 Nov 2004 15:38:36 -0000 1.4 +++ logging.xml 4 Dec 2004 20:28:27 -0000 @@ -62,14 +62,11 @@
  1. Create a file called log4j.properties with the following content and save it into common/classes.
  2. -
  3. Use the appropriate file path convention for your OS. Below is - a Window example, which on *nix might be - /var/jakarta-tomcat-5.5.4/logs/tomcat.log.
  4. -
  5. + log4j.rootLogger=debug, R
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    - log4j.appender.R.File=d:/jakarta-tomcat-5.5.4/logs/tomcat.log
    + log4j.appender.R.File=${catalina.home}/logs/tomcat.log
    log4j.appender.R.MaxFileSize=10MB
    log4j.appender.R.MaxBackupIndex=10
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    @@ -80,6 +77,10 @@
  6. Download Log4J (v1.2 or later) and place the log4j jar in $CATALINA_HOME/common/lib.
  7. +
  8. + Download Commons Logging and place the commons-logging.jar + (not commons-logging-api.jar) in $CATALINA_HOME/common/lib with + the log4j jar.
  9. Start Tomcat

@@ -93,24 +94,29 @@

You can (and should) be more picky about which packages to include - in the logging. For example try substituting the - last line of the above configuration with one of these: - + in the logging. Tomcat 5.5 uses a new way of restricting logs by Engine + name and Host. For example, for a default Catalina localhost log, add this to the + end of the log4j.properties above. Note that there are known issues with + using this naming convention (with square brackets) in log4j XML based + configuration files, so we recommend you use a properties file as described + until a future version of log4j allows this convention.

+ Be warned a level of DEBUG will produce megabytes of logging and slow startup + of Tomcat. This level should be used sparingly when debugging of internal Tomcat + operations is required.

- Your web applications should certainly use their own log4j configuration. - This is valid with the above. You would place a similar log4j.properties + In addition, your web applications should use their own log4j configuration. + This is valid with the above configuration. You would place a similar log4j.properties file in your web application's WEB-INF/classes folder, and log4j1.2.8.jar into - WEB-INF/lib. Then specify your package level logging. This is a basic setup of log4j + WEB-INF/lib (commons-logging is not required in this instance). + Then specify your package level logging. This is a basic setup of log4j and you should consult the log4j documentation - for more options: this page is intended only as a bootstrapping guide. + for more options. Note: this page is intended only as a bootstrapping guide.