<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">Ceki said:<br><br>>Perhaps the cleanest solution is to trigger reloading of the config file <br>>manually via some convenient (graphical?) user interface.<br><br>I wrote a really nice ajax based graphical UI for log4j recently for a client that does all that. <br>It worked out so well, I've been toying of the idea of making an open source one for logback.<br>I prefer logback for my own open source projects. If there is significant interest in this I might consider doing this and either contributing to logback or open sourcing it on my own...<br><br><span>PS. Ceki, I have yet another open source library that is now dependent on SLF4J (see <a target="_blank" href="http://jabsorb.org">http://jabsorb.org</a>) - nice if you
could add that to the main SLF4J page.</span><br><br>Cheers<br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Ceki Gulcu <ceki@qos.ch><br>To: logback users list <logback-user@qos.ch><br>Sent: Thursday, September 27, 2007 2:31:37 PM<br>Subject: Re: [logback-user] RE: [logback-user] logback initialization "à la" Spring<br><br><div>Hello,<br><br>Because it dispenses with the need of a separate watchdog thread, I believe that <br>the approach discussed here has significant merit.<br><br>It could be placed into a custom TurboFilter. TurboFilters get called very early <br>in the processing of a log statement. In other words, they get called every <br>time, regardless of the level of the logger in question.<br><br>The if(now > nextCheckStamp) check should avoid superfluous access to the <br>configuration file. Of course, the value of "now" would need to be
computed anew <br>for each log statement.<br><br>Preliminary tests show that a call to System.currentTimeMillis() costs about 70 <br>nanoseconds. Admittedly, 70 nanoseconds is not much but when compared to the <br>cost of a disabled log statement (10 nanoseconds), it becomes an non-negligible <br>issue.<br><br>In short, the approach is promising, with a small but non-negligible <br>computational cost.<br><br>Perhaps the cleanest solution is to trigger reloading of the config file <br>manually via some convenient (graphical?) user interface.<br><br>Arthur Blake wrote:<br>> Probably one objection to this scheme would be an extra overhead on each <br>> and every log message-- if you really look into it though, this overhead <br>> is really really minor-<br>> I think if implemented correctly, it would amount to just an extra long <br>> comparison on each log message. <br>> e.g. <br>> <br>> if (now > nextCheckTstamp)<br>>
{<br>> // kick off async file check<br>> // and then update nextCheckTstamp<br>> }<br>> <br>> Where "now" is a variable that you presumably would already have around <br>> anyway...<br>> <br>> <br>> ----- Original Message ----<br>> From: Arthur Blake <blakesys@yahoo.com><br>> To: logback users list <logback-user@qos.ch><br>> Sent: Thursday, September 27, 2007 1:11:04 PM<br>> Subject: Re: [logback-user] RE: [logback-user] logback initialization "à <br>> la" Spring<br>> <br>> Not necessarily, the reload check could be done before the OFF check...<br>> <br>> ----- Original Message ----<br>> From: Tom Leccese <tleccese@cybershift.com><br>> To: logback users list <logback-user@qos.ch><br>> Sent: Thursday, September 27, 2007 12:57:36 PM<br>> Subject: [logback-user] RE: [logback-user] logback initialization "à la" <br>>
Spring<br>> <br>> One snafu, perhaps. If all your loggers in your current config are <br>> turned OFF, then a message would never get generated, and it would never <br>> check to see if the config file has changed.<br>> <br>> -----Original Message-----<br>> *From:* logback-user-bounces@qos.ch<br>> [mailto:logback-user-bounces@qos.ch]*On Behalf Of *Arthur Blake<br>> *Sent:* Thursday, September 27, 2007 12:45 PM<br>> *To:* logback users list<br>> *Subject:* Re: [logback-user] logback initialization "à la" Spring<br>> <br>> I've used automatic reloading in the past in log4j and it certainly<br>> can be a very nice and convenient feature--<br>> <br>> There are various issues that come
up in the complexity of<br>> implementing it -- normally it's done with a separate Thread that<br>> runs and wakes up every so often to check if the file timestamp on<br>> the config file has changed.<br>> <br>> Thats a bit of a clunky and complex way to do it.<br>> <br>> I have been mentally toying with an idea for a new way to accomplish<br>> this, without having to have a separate thread-- The check could be<br>> done at the point where each log message is generated-- system wide.<br>> <br>> Since you already know the timestamp of the message generated, you<br>> could just compare that to the timestamp of the last time the log<br>> config file was reloaded-- and if a certain
amount of time has<br>> elapsed since the last time the file was checked, you kick off the<br>> code that checks to see if the file time stamp has changed, and if<br>> so, reload it (that part could be done asynchronously as well so as<br>> not to slow down other threads writing out log messages)<br>> <br>> It's simple, fast and it would have the very nice benefit of not<br>> having to have a separate Thread-- furthermore, you avoid the<br>> overhead of periodically checking the modification file stamp, over<br>> long periods when there is no log activity (such as idle periods<br>> when a server might not be getting any activity)<br>> <br>> Has anyone thought of implementing it this
way?<br>> <br>> <br>> ----- Original Message ----<br>> From: Jorg Heymans <jorg.heymans@gmail.com><br>> To: logback users list <logback-user@qos.ch><br>> Sent: Thursday, September 27, 2007 10:23:07 AM<br>> Subject: Re: [logback-user] logback initialization "à la" Spring<br>> <br>> On 9/27/07, *Davide Baroncelli* <baroncelli@yahoo.com<br>> <mailto:baroncelli@yahoo.com>> wrote:<br>> <br>> P.s.: let me express my disagreement for logback and sl4j not<br>> supporting<br>> neither the FATAL logging level nor automatic reloading of<br>>
config files.<br>> <br>> <br>> +1 for automatic reloading !<br>> <br>> Jorg<br>> <br>> <br>> ------------------------------------------------------------------------<br>> Catch up on fall's hot new shows<br>> <<a target="_blank" href="http://us.rd.yahoo.com/tv/mail/tagline/falltv/evt=47093/*http://tv.yahoo.com/collections/3658%20">http://us.rd.yahoo.com/tv/mail/tagline/falltv/evt=47093/*http://tv.yahoo.com/collections/3658%20</a>><br>> on Yahoo! TV. Watch previews, get listings, and more! <br>> <br>> <br>> This e-mail and any attachments may contain confidential and privileged <br>> information. If you are not the intended recipient, please notify the <br>> sender immediately by return e-mail, delete this e-mail and destroy any <br>> copies. Any
dissemination or use of this information by a person other <br>> than the intended recipient is unauthorized and may be illegal.<br>> <br>> <br>> ------------------------------------------------------------------------<br>> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user <br>> panel <br>> <<a target="_blank" href="http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7%20">http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7%20</a>> <br>> and lay it on us.<br>> <br>> <br>> ------------------------------------------------------------------------<br>> Looking for a deal? Find great prices on flights and hotels <br>> <<a target="_blank"
href="http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20">http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20</a>-> <br>> with Yahoo! FareChase.<br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> <a target="_blank" href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a><br><br>-- <br>Ceki Gülcü<br>Logback: The reliable, generic, fast and flexible logging framework for Java.<br><a target="_blank" href="http://logback.qos.ch">http://logback.qos.ch</a><br>_______________________________________________<br>Logback-user mailing
list<br>Logback-user@qos.ch<br><a target="_blank" href="http://qos.ch/mailman/listinfo/logback-user">http://qos.ch/mailman/listinfo/logback-user</a><br></div></div><br></div></div><br>
<hr size=1>Moody friends. Drama queens. Your life? Nope! - their life, your story.<br> <a href="http://us.rd.yahoo.com/evt=48224/*http://sims.yahoo.com/">Play Sims Stories at Yahoo! Games. </a></body></html>