Andy,
Try the following to enable the log4j watchdog:
public static void configure(final String configFile, final long delay, final Logger logger) {
PropertyConfigurator.configureAndWatch(configFile,delay);
FileWatchdog watcher = new FileWatchdog(configFile) {
public void doOnChange() {
new PropertyConfigurator().doConfigure(
filename, LogManager.getLoggerRepository()
);
if (logger != null) {
logger.info("Re-read configuration file " + filename);
}
}
};
watcher.setDelay(delay);
watcher.start();
}
Andy Kriger wrote:
I am running Tomcat 5.5 with log4j logging (log4j.properties in common/classes).
Is it possible to make changes to the log4j properties and have the changes reloaded on-the-fly instead of having to restart Tomcat in order to pick up changes? This would be very useful for those times debug level logging or specific class logging is needed where generally that level of logging is not required.
thx andy
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
