Alternative to change log4j logging level at runtime?
From: Eclifeww (sauwing.wong_at_gmail.com)
Date: 10/31/04
- Next message: Tor Iver Wilhelmsen: "Re: help with internationalization/localization"
- Previous message: Andrew Thompson: "Re: Stupid null pointer exception"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Oct 2004 01:49:59 -0700
Hi all,
I am invesitaging the way to change the log4j logging level at
runtime, and you comments are highly appreciated.
I have tried to use the logger.setLevel api which works fine in a toy
program. The toy program opens a server socket and once it receives
the client input thro' socket, it changes the logging level. However,
I am not sure whether it will has problem in multi-thread environment.
The api call in Log4j of the setLevel is simple as follows.
public void setLevel(Level level) {
this.level = level;
}
Will it be problem?, if two thread access the level instance variable
in log4j. One reading it and one updating it?
Moreover, is there any build-in mechanism in Log4j to reload the
log4j.properties at regular interval? Thus, the logging level is
reloaded accordingly.
Please englighten me.
Thanks in advance for your ideas and inputs.
Earth
- Next message: Tor Iver Wilhelmsen: "Re: help with internationalization/localization"
- Previous message: Andrew Thompson: "Re: Stupid null pointer exception"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|