[logback-user] Log separation

Dhondt, Edwin edwin.dhondt at hp.com
Thu Apr 29 12:10:42 CEST 2010


Given [1] http://logback.qos.ch/manual/loggingSeparation.html and especially the part BEFORE the sentence "So are we done yet? Can we declare victory and go home? Well, not quite."
I would say yes.

Given the the part AFTER the sentence "So are we done yet? Can we declare victory and go home? Well, not quite." 
I would say no. Because in that paragraph one starts talking about:
[snip]
"Note that even if the ch.qos.starwars.shared.Mustafar logger outputs to kenobi.log it is still attached to 'yoda'. Thus, we have two distinct logging contexts logging to the same file, in this case kenobi.log. Each of these contexts reference FileAppender instances, nested within distinct SiftingAppender instances, logging to the same file. Although logging separation seems to function according to our wishes, FileAppender instances cannot safely write to the same file unless they enable prudent mode. Otherwise, the target file will be corrupted."
[/snip]
That is one starts talking about the fact different logging contexts are logging to the same file, and that file appenders are writing to the same file and that the latter is not save and that therefore prudent mode should be used. Too me, the latter indicates there is no log separation anymore in the scenario described. 
Is that correct ? If not, where am I missing the point ?

-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Ceki Gülcü
Sent: donderdag 29 april 2010 11:39
To: logback users list
Subject: Re: [logback-user] Log separation

On 29/04/2010 10:55 AM, Dhondt, Edwin wrote:

 > So can I be sure that when following all the steps in [1] the yoda
 > web-app will only write to yoda.log and the Kenobi web-app will only
 > write to Kenobi.log indepent on which application is started first and
 > calls the shared code the first ?  That is, can I be sure that when
 > following [1] I won't have any contention because yoda threads will
 > write to yoda.log and Kenobi-initiated threads will write to
 > Kenobi.log ?

Given the previous lengthy discussion, what do you think?

--
Ceki
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user


More information about the Logback-user mailing list