logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kohinoor Lal Verma (EHS)" <Kohinoor.Ve...@ehs.ericsson.se>
Subject RE: Change properties at runtime
Date Thu, 12 Dec 2002 12:57:42 GMT
Thank Shapira,

Canyou tell me some properties that are nor reset-able ???



Kohinoor Lal Verma,
Senior Systems Engineer,
Ericsson Mobile Commerce Platform, 
New Delhi, India.

-----Original Message-----
From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
Sent: Wednesday, December 11, 2002 6:37 PM
To: Log4J Users List
Subject: RE: Change properties at runtime

Don't re-configure.  Programatically traverse the logger and/or appender
tree to set properties you want.  Not all properties are reset-able at

For example, to change the logger level at runtime:

private static void changeLoggerLevel(String fqcn, String level)
  if((fqcn == null) || (level == null))
  Logger logger = Logger.getLogger(fqcn);

I omitted exception handling code from the above, and I'm assuming
you're using the standard logger name = class (or package) name
convention.  FQCN stands for fully-qualified class name, but is a bit of
a mis-nomer as the above will work for a package as well.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Kohinoor Lal Verma (EHS) [mailto:Kohinoor.Verma@ehs.ericsson.se]
>Sent: Wednesday, December 11, 2002 6:14 AM
>To: 'Log4J Users List'
>Subject: Change properties at runtime
>I have a problem.
>I want change some properties of log4j on the fly without affecting
rest of
>the properties.
>I have tried useing PropertyConfigurator.configure(). Calling this
>removes all previously configured properties and only the new
>set. Can anybody help ???
>Kohinoor Lal Verma,
>Senior Systems Engineer,
>Ericsson Mobile Commerce Platform,
>New Delhi, India.
>To unsubscribe, e-mail:   <mailto:log4j-user-
>For additional commands, e-mail: <mailto:log4j-user-

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

View raw message