I am using BasicConfigurator() to configure my Log4J properties..infact u
can even use PropertyConfigurator() class to configure ur Log4J from an
properties file..example as follows:

 

BasicConfigurator.configure();

 

Or

 

Logger.getLoggerRepository().getRootLogger(new ConsoleAppender(new
PatternLayout("[%d{ISO8601} %-5p][%20.20c][%t] %m%n")));

 

 

If it is a webapp that u are developing u might need to use classloader to
load ur property file. Example as follows:

 

ClassLoader loader = Foo.class.getClassLoader();

loader.getResource("myapp/log4jproperties.txt")));

 

See if this helps

vinodh

 

-----Original Message-----
From: Nestor Boscan [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 08, 2004 1:26 PM
To: [EMAIL PROTECTED]
Subject: Log4J configuration for library

 

Hi

 

I'm developing a library and I'm using Log4J. I've had problems with

applications that use the library and use log4j at the same time. For some

reason the configuration gets messed up. I'm using a log4j.properties file

inside de .jar library. Is there a correct way to configure log4j for

libraries?

 

Regards,

 

Néstor Boscán

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to