于 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().