You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "GREVER,PAT (HP-Boise,ex1)" <pa...@hp.com> on 2003/08/08 18:36:50 UTC

Separate configs for different webapps

Hi,

I am probably asking a stupid question here because I am new to log4j and
tomcat.

I have two webapps running under tomcat (single JVM) that are sharing common
libraries.  I am trying to find a way to set up the logging properties such
that the two webapps have different settings (i.e., different appenders,
layouts, levels, etc.).  I've tried putting a log4j.properties file in the
classes directory for each of my webapps, but it seems it only automatically
picks up the one associated with whichever webapp is started first by tomcat
(the other one is never loaded).  If I put an explicit call in both webapps
to the PropertyConfigurator, it seems that whichever one loads last
overwrites the previous settings.  Can I get different settings for each of
my webapps somehow?

Pat Grever
Software Development Engineer
iIPS Connectivity - Management & Applications Lab
Phone:  208.396.2522
Fax:      208.396.4796
pat_grever@hp.com