logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinodh Srinivasasainagendra <vin...@uab.edu>
Subject RE: Log4J configuration for library
Date Fri, 08 Oct 2004 18:33:50 GMT
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:nestor.boscan@tcs.com.ve] 
Sent: Friday, October 08, 2004 1:26 PM
To: log4j-user@logging.apache.org
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: log4j-user-unsubscribe@logging.apache.org

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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message