dcsimg
How to change the loglevel for log4j at runtime ?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michel_Jonker
Posted On:   Wednesday, November 27, 2002 08:18 AM

In the FAQ section of the log4j pages (http://jakarta.apache.org/log4j/docs/FAQ.html#behavior )it says:



Log behavior can be set using configuration files which are parsed at runtime.



But are the 'reparsed' at runtime ? I changed the levels in my lgo4j.properties file, but the changes are not effective until I restart my webapp.


Thanks


Michel

Re: How to change the loglevel for log4j at runtime ?

Posted By:   Alex_Kobyakov  
Posted On:   Monday, December 2, 2002 12:31 AM

Try to issue following command at the init:


PropertyConfigurator.configureAndWatch(configFileName);

or use

PropertyConfigurator.configureAndWatch(configFileName, time);

Re: How to change the loglevel for log4j at runtime ?

Posted By:   Anonymous  
Posted On:   Thursday, November 28, 2002 03:34 AM

The FAQ gives an answer: http://jakarta.apache.org/log4j/docs/FAQ.html#configureandwatch :-) But it´s a very small one: see the javadoc.


I have searched some minutes the javadoc and the log4j.dtd. I haven´t found any parameter for setting the configureAndWatch interval. But you can set your own category-factory. So you can write such a factory which sets that flag. (Not very nice...)

About | Sitemap | Contact