Thank Shapira,

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


Rgds
Kohinoo



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

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

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


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

For example, to change the logger level at runtime:

private static void changeLoggerLevel(String fqcn, String level)
{
  if((fqcn == null) || (level == null))
    return;
  
  Logger logger = Logger.getLogger(fqcn);
  logger.setLevel(Level.toLevel(level));
}

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:[EMAIL PROTECTED]]
>Sent: Wednesday, December 11, 2002 6:14 AM
>To: 'Log4J Users List'
>Subject: Change properties at runtime
>
>Hi,
>
>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
method
>removes all previously configured properties and only the new
properties
>are
>set. Can anybody help ???
>
>
>Rgds
>Kohinoor
>
>
>-----------------------------
>
>Kohinoor Lal Verma,
>Senior Systems Engineer,
>Ericsson Mobile Commerce Platform,
>New Delhi, India.
>
>--
>To unsubscribe, e-mail:   <mailto:log4j-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:log4j-user-
>[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to