Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuseSupport




JSPWiki v2.2.33

[RSS]


Hide Menu

Tomcat5Logging


Difference between version 11 and version 4:

At line 1 changed 1 line.
Configuring (and more importantly, supressing) Tomcat 5.x logging
Configuring (and more importantly, supressing) Tomcat 5.x logging using Log4j
At line 3 added 3 lines.
PLEASE NOTE: These instructions are for setting up Tomcat with log4j logging, your web application
can still have its own log4j.properties deployed to its WEB-INF/classes directory..
At line 11 changed 1 line.
log4j.appender.R.layout.ConversionPattern={%p} %c{2} %x %m%n
log4j.appender.R.layout.ConversionPattern={%p} %c{2} %x %m%n
At line 14 changed 1 line.
You also need to copy commons-logging.jar and log4j-1.2.9.jar to $CATALINA_HOME/common/lib.
You also need to copy commons-logging.jar and log4j-1.2.9.jar to $CATALINA_HOME/common/lib. Note,
some references say copy these files to $CATALINA_HOME/server/lib, but for me, copying to common/lib worked fine.
At line 36 added 1 line.
Note: If you want Tomcat logging to stdout as well, then your $CATALINA_HOME/common/classes/log4j.properties file should look like this:
At line 38 added 2 lines.
{{{
log4j.rootLogger=ERROR, stdout, TOMCAT
At line 41 added 18 lines.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd-MM-yy HH:mm:ss:SSS} - {%p} %c{2} Thread [%t]; %x %m%n
log4j.appender.TOMCAT=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TOMCAT.File=${catalina.home}/logs/tomcat.log
log4j.appender.TOMCAT.DatePattern='.'yyyy-MM-dd
log4j.appender.TOMCAT.layout=org.apache.log4j.PatternLayout
log4j.appender.TOMCAT.layout.ConversionPattern=%d{dd-MM-yy HH:mm:ss:SSS} - {%p} %c{2} Thread [%t]; %x %m%n
}}}
For more on Tomcat 5 see here [Tomcat 5 Upgrade|Tomcat5Upgrade]
For the official Tomcat 5.5 docs on logging see here [Tomcat 5.5 Logging|http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html]
If you cannot get the above instructions to work, then should remove the files you placed within the tomcat
distribution and Tomcat will revert back to using commons logging.

Back to Tomcat5Logging, or to the Page History.