Hi,

You don't change Catalina (for most purposes). Just change end part /webappname 
to your web application name, and yes, add it into the web application's log4j. 
E.g if your webapp was called banana

You would add (in addition to the root logger etc..) into 
webapps/banana/WEB-INF/classes/log4j.properties

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][/banana]=DEBUG,
 R

Allistair.

> -----Original Message-----
> From: Scott Purcell [mailto:[EMAIL PROTECTED]
> Sent: 02 August 2005 14:49
> To: Tomcat Users List
> Subject: RE: Logging With Tomcat 5.5
> 
> 
> Allistair,
> 
> That last instruction
> "log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina
> ].[localhost][/webappname]=DEBUG, R "
> 
> What do I change the [Catalina] value to?
> and that does go into the log4j.properties file under the webapp?
> 
> Thanks,
> Scott
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Allistair Crossley [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 02, 2005 8:31 AM
> To: Tomcat Users List
> Subject: RE: Logging With Tomcat 5.5
> 
> 
> Don't confuse "not understanding" with "not sufficient". The 
> instructions do lead to a correct configuration. However, 
> here it is more explicitly.
> 
> Allistair.
> 
> Per-webapp logging
> ==================
> 
> 1. Add log4j's jar to both your webapp's WEB-INF/lib folders
> 2. Add log4j.properties to both your webapp's WEB-INF/classes 
> folders. *Minimally*, add
> 
> log4j.rootCategory=debug, R
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=c:/jakarta-tomcat/logs/webapp-name.log
> log4j.appender.R.MaxFileSize=1500KB
> log4j.appender.R.MaxBackupIndex=1
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
> 
> to those log4j.properties 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 log4j.properties to common/classes with content
> 
> log4j.rootCategory=error, R
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=c:/jakarta-tomcat/logs/tomcat.log
> log4j.appender.R.MaxFileSize=1500KB
> log4j.appender.R.MaxBackupIndex=1
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%d - %5p (%C:%L) - %m%n
> 
> log4j.logger.org.apache.commons.modeler=INFO, R
> log4j.logger.org.apache.tomcat.util.digester=ERROR, R
> log4j.logger.org.apache.catalina.loader=INFO, R
> log4j.logger.org.apache.catalina.session=INFO, R
> log4j.logger.org.apache.catalina=DEBUG, R
> log4j.logger.org.apache.commons.digester=INFO, R
> log4j.logger.org.apache.commons.beanutils=INFO, R
> log4j.logger.org.apache.jasper=INFO, R
> log4j.additivity.org.apache.catalina=false
> 
> Tomcat logging per-webapp
> =========================
> 
> Add to your webapp's log4j.properties files
> 
> log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina]
> .[localhost][/webappname]=DEBUG, R 
> 
> > -----Original Message-----
> > From: Scott Purcell [mailto:[EMAIL PROTECTED]
> > Sent: 02 August 2005 14:22
> > To: tomcat-user@jakarta.apache.org
> > 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 
> > "http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html";
> >  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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> <FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
> -------------------------------------------------------
> QAS Ltd.
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> -------------------------------------------------------
> </FONT>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to