logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "GREVER,PAT (HP-Boise,ex1)" <pat.gre...@hp.com>
Subject RE: Separate configs for different webapps
Date Fri, 08 Aug 2003 20:50:18 GMT
Follow on question...

Some of my code is shared among several webapps.  We've been installing the
jar files in the tomcat shared/lib directory.  I'd like the log messages
from these shared components to use the same logging configuration as the
specific webapp that is calling them is using.  Essentially things running
on a particular thread (and child threads it starts) would use the same log

If I use the solution mentioned (i.e., putting the log4j.jar in the webapp's
classes directory), it seems like this will only cause the classes
associated with the webapp to use the logging configuration?  In other
words, won't log calls from the shared jars use a different logging
configuration than the webapp methods that are calling them?

If this is a problem, then is there a way around it?

It seems like I want some type of logging "context" that I can establish on
a thread that defines ALL of the log settings, not just a name.


-----Original Message-----
From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
Sent: Friday, August 08, 2003 10:57 AM
To: Log4J Users List
Subject: RE: Separate configs for different webapps

Yes.  Instead of them sharing log4j.jar, put a copy of the jar in each
app's WEB-INF/lib folder.  Then keep the separate config files as you've
done, in each app's WEB-INF/classes folder.  Make sure there's no
log4j.jar in tomcat's common/lib directory.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: GREVER,PAT (HP-Boise,ex1) [mailto:pat.grever@hp.com]
>Sent: Friday, August 08, 2003 12:37 PM
>To: log4j-user@jakarta.apache.org
>Subject: Separate configs for different webapps
>I am probably asking a stupid question here because I am new to log4j
>I have two webapps running under tomcat (single JVM) that are sharing
>libraries.  I am trying to find a way to set up the logging properties
>that the two webapps have different settings (i.e., different
>layouts, levels, etc.).  I've tried putting a log4j.properties file in
>classes directory for each of my webapps, but it seems it only
>picks up the one associated with whichever webapp is started first by
>(the other one is never loaded).  If I put an explicit call in both
>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

This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.

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

View raw message