logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim the Standing Bear" <standingb...@gmail.com>
Subject How to pick a specific log4j as well its properties file?
Date Thu, 15 Nov 2007 18:57:00 GMT
Hi all,

>From an earlier problem, I discovered that my application wasn't using
the log4j.properties I supplied.  In fact, I am not even sure if it
was using the log4j from log4j-1.2.13.jar that I supplied.

This is because my app also uses cog-jglobus, which contains its own
version of log4j.  By turning on the debug option, I discovered that
the log4j was first looking for XML properties file, which it could
not find, then it somehow knew there would be a log4j.properties file
packaged in cog-jglobus-1.4.jar, and it used that instead.  After I
repackaged cog-jglobus by removing the log4j.properties,  it started
to use the properties file that came with axis2-0.93.jar.

So it becomes impractical for me to repackage every single frigging
jar that comes with its own log4j.properties.  So what is the best way
to specify the app to use the log4j from log4j-1.2.13.jar, as well as
my own log4j.properties?

Currently my code reads a properties file for the application, and one
property specifies where logj4.properties is.  I would then use that
property value to supply PropertyConfigurator.configure()  in the
constructor of the entry class.  It seems that this may not be the
best way to do so since log4j automatically read other properties file
prior to this one.


-- Jim

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message