Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 85961 invoked from network); 2 Aug 2005 13:31:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2005 13:31:31 -0000 Received: (qmail 26400 invoked by uid 500); 2 Aug 2005 13:31:07 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 26351 invoked by uid 500); 2 Aug 2005 13:31:07 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26306 invoked by uid 99); 2 Aug 2005 13:31:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 06:31:06 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: error (asf.osuosl.org: local policy) Received: from [195.172.82.137] (HELO mail3.qas.com) (195.172.82.137) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 06:30:56 -0700 Received: from orion.qas.com (orion.qas.com) by mail3.qas.com (Content Technologies SMTPRS 4.3.17) with ESMTP id for ; Tue, 2 Aug 2005 14:30:34 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Logging With Tomcat 5.5 Date: Tue, 2 Aug 2005 14:30:33 +0100 Message-ID: <5684A7E6FB10504393A2806C1F4C0210076CE1EE@orion.qas.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Logging With Tomcat 5.5 Thread-Index: AcWXZTgRHP/sek+CRV2eJ9WGwzs7yAAACkXw From: "Allistair Crossley" To: "Tomcat Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Don't confuse "not understanding" with "not sufficient". The instructions d= o lead to a correct configuration. However, here it is more explicitly. Allistair. Per-webapp logging =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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. *Min= imally*, add log4j.rootCategory=3Ddebug, R log4j.appender.R=3Dorg.apache.log4j.RollingFileAppender log4j.appender.R.File=3Dc:/jakarta-tomcat/logs/webapp-name.log log4j.appender.R.MaxFileSize=3D1500KB log4j.appender.R.MaxBackupIndex=3D1 log4j.appender.R.layout=3Dorg.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=3D%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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=3Derror, R log4j.appender.R=3Dorg.apache.log4j.RollingFileAppender log4j.appender.R.File=3Dc:/jakarta-tomcat/logs/tomcat.log log4j.appender.R.MaxFileSize=3D1500KB log4j.appender.R.MaxBackupIndex=3D1 log4j.appender.R.layout=3Dorg.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=3D%d - %5p (%C:%L) - %m%n log4j.logger.org.apache.commons.modeler=3DINFO, R log4j.logger.org.apache.tomcat.util.digester=3DERROR, R log4j.logger.org.apache.catalina.loader=3DINFO, R log4j.logger.org.apache.catalina.session=3DINFO, R log4j.logger.org.apache.catalina=3DDEBUG, R log4j.logger.org.apache.commons.digester=3DINFO, R log4j.logger.org.apache.commons.beanutils=3DINFO, R log4j.logger.org.apache.jasper=3DINFO, R log4j.additivity.org.apache.catalina=3Dfalse Tomcat logging per-webapp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Add to your webapp's log4j.properties files log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost][= /webappname]=3DDEBUG, R=20 > -----Original Message----- > From: Scott Purcell [mailto:spurcell@vertisinc.com] > Sent: 02 August 2005 14:22 > To: tomcat-user@jakarta.apache.org > Subject: Logging With Tomcat 5.5 >=20 >=20 > Hello, >=20 > I am sure this topic has been beaten to death, but I am=20 > having trouble understanding how the Log4J works, and how I=20 > can configure it on my localbox. >=20 > First off, I am running Tomcat 5.5 and I have created two=20 > webapp contexts. One is a dev site, and the other is a=20 > production site. I am using struts (I don't think it matters). >=20 > I would to be able to have two sets of rolling logs. One for=20 > dev, and the other for production. I am trying to decipher=20 > the readme at=20 > "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=20 > this is implying. >=20 > I would like to get all Tomcat messages (errors, etc) and my=20 > actual logging all in either one or two files per webapp. >=20 >=20 > Can someone please assist me in this? The readme just doesn't=20 > cut it, or I am interpreting it wrongly. Or maybe there is an=20 > example setup somewhere. >=20 > Any info would be appreciated. > Sincerely > Scott >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >=20 >=20 =20 ------------------------------------------------------- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 ------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org