tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <>
Subject RE: Logging With Tomcat 5.5
Date Tue, 02 Aug 2005 13:30:33 GMT
Don't confuse "not understanding" with "not sufficient". The instructions do lead to a correct
configuration. However, here it is more explicitly.


Per-webapp logging

1. Add log4j's jar to both your webapp's WEB-INF/lib folders
2. Add to both your webapp's WEB-INF/classes folders. *Minimally*, add

log4j.rootCategory=debug, R
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n

to those files changing the File path appropriately.

Ideally you will pick up the log4j manual and create appenders that map to packages.

Tomcat logging with log4j

I've found the best way is

1. Add log4j jar to common/lib, add commons-logging.jar to common/lib
2. Add to common/classes with content

log4j.rootCategory=error, R
log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n, R, R, R, R, R, R, R, R

Tomcat logging per-webapp

Add to your webapp's files[Catalina].[localhost][/webappname]=DEBUG,

> -----Original Message-----
> From: Scott Purcell []
> Sent: 02 August 2005 14:22
> To:
> Subject: Logging With Tomcat 5.5
> Hello,
> I am sure this topic has been beaten to death, but I am 
> having trouble understanding how the Log4J works, and how I 
> can configure it on my localbox.
> First off, I am running Tomcat 5.5 and I have created two 
> webapp contexts. One is a dev site, and the other is a 
> production site. I am using struts (I don't think it matters).
> I would to be able to have two sets of rolling logs. One for 
> dev, and the other for production. I am trying to decipher 
> the readme at 
> ""
>  but I am not truly sure if this is for all webapps, or what 
> this is implying.
> I would like to get all Tomcat messages (errors, etc) and my 
> actual logging all in either one or two files per webapp.
> Can someone please assist me in this? The readme just doesn't 
> cut it, or I am interpreting it wrongly. Or maybe there is an 
> example setup somewhere.
> Any info would be appreciated.
> Sincerely
> Scott
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message