Re: [logback-user] logback initialization "à la" Spring

Arthur Blake blakesys at yahoo.com
Thu Sep 27 18:45:21 CEST 2007


I've used automatic reloading in the past in log4j and it certainly can be a very nice and convenient feature--

There are various issues that come up in the complexity of implementing it -- normally it's done with a separate Thread that runs and wakes up every so often to check if the file timestamp on the config file has changed.

Thats a bit of a clunky and complex way to do it.

I have been mentally toying with an idea for a new way to accomplish this, without having to have a separate thread-- The check could be done at the point where each log message is generated-- system wide.

Since you already know the timestamp of the message generated, you could just compare that to the timestamp of the last time the log config file was reloaded-- and if a certain amount of time has elapsed since the last time the file was checked, you kick off the code that checks to see if the file time stamp has changed, and if so, reload it (that part could be done asynchronously as well so as not to slow down other threads writing out log messages)

It's simple, fast and it would have the very nice benefit of not having to have a separate Thread-- furthermore, you avoid the overhead of periodically checking the modification file stamp, over long periods when there is no log activity (such as idle periods when a server might not be getting any activity)

Has anyone thought of implementing it this way?


----- Original Message ----
From: Jorg Heymans <jorg.heymans at gmail.com>
To: logback users list <logback-user at qos.ch>
Sent: Thursday, September 27, 2007 10:23:07 AM
Subject: Re: [logback-user] logback initialization "à la" Spring

On 9/27/07, Davide Baroncelli <baroncelli at yahoo.com> wrote:

P.s.: let me express my disagreement for logback and sl4j not supporting
neither the FATAL logging level nor automatic reloading of config files.


+1 for automatic reloading !

Jorg








      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20070927/5f926b9f/attachment.htm 


More information about the Logback-user mailing list