You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Donevan Dolby <do...@base2s.com> on 2013/04/26 18:12:48 UTC
ConfigureAndWatch
All,
I have recently inherited a project that is using log4cxx and one thing I
want to change is to dynamically change the logging level as the
application is running. This looks like it should be possible
using DOMConfigurator::configureAndWatch("./log4cxx.xml", 1000); which
should check the log file every second to see if it has changed. If i
change the logging level in the file and save it out it has no affect on my
logs, however, if I restart it takes the new settings. I have attached to
the running application and see no watchdog thread that would be checking
if the file has been updated. Any help would be appreciated
Donevan
Re: ConfigureAndWatch
Posted by 金庆 <ji...@163.com>.
于 2013-4-27 0:12, Donevan Dolby 写道:
> All,
>
> I have recently inherited a project that is using log4cxx and one
> thing I want to change is to dynamically change the logging level as
> the application is running. This looks like it should be possible
> using DOMConfigurator::configureAndWatch("./log4cxx.xml", 1000); which
> should check the log file every second to see if it has changed. If i
> change the logging level in the file and save it out it has no affect
> on my logs, however, if I restart it takes the new settings. I have
> attached to the running application and see no watchdog thread that
> would be checking if the file has been updated. Any help would be
> appreciated
>
> Donevan
The watchdog thread will disappear after fork() or daemon(). Should
configureAndWatch() after fork().