RE: "Watching" the config file

Can anyone tell me if "watching" the config file for changes is planned for logback? Being unable to control the logging configuration without a restart is a big problem for my applications. Thanks, Ted From: Ted Graham [mailto:tgraham@ConcordEnergy.com] Sent: Thursday, October 04, 2007 2:22 PM To: 'logback-user@qos.ch' Subject: "Watching" the config file One of my favorite log4j features is the ability to watch the config file and reload it when it has changed. Any plans to support that in logback? I searched this list's archives and found some discussion of this feature, but nothing definitive. Thanks, Ted

Hello Ted, The question was discussed in a previous thread: http://www.qos.ch/pipermail/logback-user/2007-September/000329.html To cut a long story short, the currently preferred approach is to trigger reloading of the config file via a user interface. Arthur Blake mentioned a utility that he wrote which does this. May I ask you to enter a bug report requesting this feature? HTH, Ted Graham wrote:
Can anyone tell me if “watching” the config file for changes is planned for logback?
Being unable to control the logging configuration without a restart is a big problem for my applications.
Thanks,
Ted
*From:* Ted Graham [mailto:tgraham@ConcordEnergy.com] *Sent:* Thursday, October 04, 2007 2:22 PM *To:* 'logback-user@qos.ch' *Subject:* "Watching" the config file
One of my favorite log4j features is the ability to watch the config file and reload it when it has changed. Any plans to support that in logback?
I searched this list’s archives and found some discussion of this feature, but nothing definitive.
Thanks,
Ted
------------------------------------------------------------------------
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

Ceki Gulcu wrote:
Hello Ted, The question was discussed in a previous thread: http://www.qos.ch/pipermail/logback-user/2007-September/000329.html
Note also that in that thread I attached code that may be used to obtain a periodic configuration reloader in Spring: even without Spring, using a timer to trigger the reload is a pretty simple task. -- View this message in context: http://www.nabble.com/%22Watching%22-the-config-file-tf4571293.html#a1329069... Sent from the Logback User mailing list archive at Nabble.com.

Davide Baroncelli wrote:
Ceki Gulcu wrote:
Hello Ted, The question was discussed in a previous thread: http://www.qos.ch/pipermail/logback-user/2007-September/000329.html
Note also that in that thread I attached code that may be used to obtain a periodic configuration reloader in Spring: even without Spring, using a timer to trigger the reload is a pretty simple task.
Note also that that solution allows using a work manager thread from the application server: using a library that creates and manages threads by itself (as Log4j config reloader does) is strongly discouraged (in fact log4j thread may not be shut down at web application reloads and creates class loader problems upon reloading). -- View this message in context: http://www.nabble.com/%22Watching%22-the-config-file-tf4571293.html#a1329069... Sent from the Logback User mailing list archive at Nabble.com.

Note also that that solution allows using a work manager thread from the application server: using a library that creates and manages threads by itself (as Log4j config reloader does) is strongly discouraged (in fact log4j thread may not be shut down at web application reloads and creates class loader problems upon reloading).
I have a several applications, each with a Main method. Having the library create and manage a thread for me is not a problem in my application, writing the thread to watch and reload is a pain. I'm not saying your objections are valid, just that there are scenarios where automatic reloading would be a very useful feature. While I could create a class that encapsulates the thread that watches and reloads the config, it doesn't seem like every user of logback should have to write that class. I'm also using logback via slf4j, and writing that class would couple my application to logback. I'm fine with the watchConfig config file setting having some disclaimers or warnings on it, but I think it needs to exist. Ted
participants (3)
-
Ceki Gulcu
-
Davide Baroncelli
-
Ted Graham