Return-Path: Delivered-To: apmail-jakarta-log4j-user-archive@www.apache.org Received: (qmail 69716 invoked from network); 22 Nov 2003 13:01:47 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 22 Nov 2003 13:01:47 -0000 Received: (qmail 33225 invoked by uid 500); 22 Nov 2003 13:01:40 -0000 Delivered-To: apmail-jakarta-log4j-user-archive@jakarta.apache.org Received: (qmail 33214 invoked by uid 500); 22 Nov 2003 13:01:40 -0000 Mailing-List: contact log4j-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@jakarta.apache.org Received: (qmail 33200 invoked from network); 22 Nov 2003 13:01:39 -0000 Received: from unknown (HELO sccrmhc11.comcast.net) (204.127.202.55) by daedalus.apache.org with SMTP; 22 Nov 2003 13:01:39 -0000 Received: from nicki.visi.com (c-24-118-19-12.mn.client2.attbi.com[24.118.19.12]) by comcast.net (sccrmhc11) with SMTP id <2003112213013901100nnutre>; Sat, 22 Nov 2003 13:01:39 +0000 Message-Id: <5.2.1.1.0.20031122065253.02780200@shell.visi.com> X-Sender: hoju@shell.visi.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Sat, 22 Nov 2003 07:01:38 -0600 To: "Log4J Users List" From: Jacob Kjome Subject: Re: setting up multiple log4j configurations for multiple WAR pac kage s? In-Reply-To: References: <70BBED1A2BBDD711A4340008C79188AF9A5616@SZUMAIL> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N No, his statement is incorrect. You can utilize a repository selector to separate logging using a single instance of log4j.jar. Read here... http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging In fact, if you use Tomcat, even without using a repository selector, you can provide for container logging and webapp logging, all completely separated. Put log4j.jar in CATALINA_HOME/common/lib, put a log4j.xml in CATALNIA_HOME/common/classes, and then put log4j.jar in each WEB-INF/lib and either do manual configuration with log4j.xml somewhere like WEB-INF or do auto-config with it in WEB-INF/classes. All your logging should be separated without even bothering with a repository selector. This behavior depends on the way the class loaders are set up, though. Tomat loads classes and resources from the WebappClassLoader preferentially to higher class loaders. This is opposite the normal Java2 class loader behavior, but defined (I believe) by the servlet spec. Other containers such as JBoss don't seem to do this by default, although you can configure them to do it. As such, using the repository selectors is the only guaranteed way to achieve separated logging. Jake At 04:01 AM 11/22/2003 -0800, you wrote: >So if the server itself uses log4j for logging, does that mean that you >will not be able to configure individual web apps to work independently of >each other and or the server? > >On Friday, November 21, 2003, at 07:36 AM, Ken.Liu@bmwna.com wrote: > >>IMHO, the simplest and easiest configuration to maintain is to place >>log4j.jar in WEB-INF/lib and log4j.xml in WEB-INF/classes in each WAR. This >>should work fine without any additional server configuration. You should >>not have log4j.jar in your server's classpath or logging won't be separate >>between webapps. >> >>Ken >> >>>-----Original Message----- >>>From: Yuzwa, Erik [mailto:Erik.Yuzwa@encana.com] >>>Sent: Friday, November 21, 2003 8:30 AM >>>To: 'Log4J Users List' >>>Subject: setting up multiple log4j configurations for multiple WAR >>>package s? >>> >>> >>>Hi all, >>> >>>I'm sorry if this is a FAQ, as I've looked everywhere and >>>can't find very >>>many >>>resources on setting up multiple log4j configurations for >>>different WAR >>>packages >>>(ie. a seperate set of log files for each WAR app). >>> >>>I've tried including a log4j.xml and log4j.blah.jar file with >>>each WAR, but >>>that >>>doesn't seem to work properly. >>> >>>Is there a configuration setting that I'm missing on the >>>servlet container >>>itself? >>>Should the log4j.blah.jar file be in the classpath of the >>>servlet container >>>or >>>remain on the application layer? >>> >>>thanks! >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org >>>For additional commands, e-mail: log4j-user-help@jakarta.apache.org >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org >>For additional commands, e-mail: log4j-user-help@jakarta.apache.org >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: log4j-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: log4j-user-help@jakarta.apache.org