[logback-user] Log separation

Ceki Gülcü ceki at qos.ch
Thu Apr 29 10:43:59 CEST 2010


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



More information about the Logback-user mailing list