[logback-user] Log separation

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


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 ? 

Edwin

-----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 10:44
To: logback users list
Subject: Re: [logback-user] Log separation

On 29/04/2010 8:59 AM, Dhondt, Edwin wrote:

[snip]

 > That is, coming back to the starwars example when I open the yoda.log
 > I only want to see log messages produced in the context of running the
 > Yoda webapp.  That is, when I open the kenobi.log I only want to see
 > log messages produced in the context of running the Kenobi webapp.

 > Is the above interpretation correct ?

Yes, that is the problem solved by [1].

[snip]
 > From the diagram and the above excerpt (***) of the example in the
 > manual I can only deduce that log messages produced "in the context
 > of" Kenobi will be scattered over two files because when the Yoda app
 > is initialized the first, the Mustafar logger will be "bound" to the
 > Yoda context, not the Kenobi context. Thereby, log messages produced
 > while running Kenobi will be scattered over yoda.log and Kenobi.log.
 > Is that correct ? If yes, then there's no log separation.

There is log separation because of SiftingAppender, that's the whole
beauty of the approach. Separation is done at two levels. First at
logger retrieval time by ContextJNDISelector which will return loggers
attaching them to the context of the web-app. This works well for
instance loggers in non-shared classes. For static loggers in shared
classes which are bound to the first context that calls them,
SiftingAppender performs a second level of separation.

HTH,

[1] http://logback.qos.ch/manual/loggingSeparation.html

--
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