For our web applications deployed within tomcat 5.x we use a custom context 
selector to allow use of multiple independent logback configurations and 
implementations.  We use logback for tomcat internal logging (via commons 
logging over slf4j) and application level logging.  Each web application and 
tomcat has it's own logback configuration file, own set of logback related jars 
and is separately controllable via JMX.  We did not put any logback, slf4j, 
etc. related jars into TOMCAT_HOME/common/lib - instead they are in 
TOMCAT_HOME/server/lib.

The high level of isolation simplifies our development and deployment 
practices.  In general, we did not want any logging related jar or 
configuration dependencies between tomcat and the multiple web applications.  
We accomplished our isolation goals by developing a custom ContextSelector, 
however if there were different or better options for isolation we would look 
at those.  In other words, we're not set on using a ContextSelector 
implementation - we just want strict isolation.

I should mention that we potentially don't use ContextSelector in its 
originally intended manner.  We tried the JNDI based ContextSelector that ships 
with logback, but JNDI is not available when tomcat starts doing internal 
logging so we had trouble separating tomcat logging from application level 
logging when using the JNDI ContextSelector.  Anyway, our ContextSelector 
implementation boils down to using a classpath-based resource for logging 
configuration.  We don't really do any dynamic context selection like that of 
ch.qos.logback...LoggerContextFilter.

Hope that makes sense and helps.

-casey



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ceki Gulcu
Sent: Friday, December 26, 2008 7:02 AM
To: logback users list
Subject: [SPAM] - [logback-user] Context selectors useful? - Email found in 
subject


Hello all,

I am in the process of fixing bugs related to context selectors in logback. 
However, while sometime ago I thought that context selectors were the wave of 
the future, I am increasingly skeptical about their usefulness (of context 
selectors).

If you are using context selectors, could you please explain why?

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to