logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject RE: Appender configuration question
Date Wed, 23 Apr 2008 13:11:23 GMT
First: 
It is not recommended to include the log4j.xml into a jar file, especially not for third party
library. Therefore the best way to solve your problem is either to remove the file from the
jar or - even better - ask the vendor of the library to do that.

If both is not possible, then you can try following:
- manipulate the class path in order that your log4j.xml is found before the one of the other
library
- your own code should accesses the log4j framework before the library does, i.e. within a
static initializer of your main class.

Heri

> -----Original Message-----
> From: NBW [mailto:emailnbw@gmail.com]
> Sent: Tuesday, April 22, 2008 10:28 PM
> To: log4j-user@logging.apache.org
> Subject: Appender configuration question
> 
> 
> I have a situation where I have my application JAR file which 
> includes a 3rd
> party library JAR. This 3rd party library jar includes a 
> log4j.xml file
> which configures some file appenders. My application's main 
> class contains a
> static Logger and its main method uses 
> BasicConfigurator.configure(). What I
> am noticing is that my application log output and log output 
> from the 3rd
> party JAR are logging to BOTH the console and to the files 
> specified in the
> 3rd party JARs log4j.xml file. I want everything to only log to the
> appenders my application specifies (namely the console). Can 
> someone give me
> some advice on doing this? Thanks.
> 

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


Mime
View raw message