logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: log4j-2.0 questions
Date Tue, 21 Jun 2011 03:19:20 GMT

On Jun 20, 2011, at 5:04 PM, Gary Gregory wrote:

> 
> 
> On Jun 20, 2011, at 17:33, "ralph.goers @dslextreme.com" <ralph.goers@dslextreme.com<mailto:ralph.goers@dslextreme.com>>
wrote:
> 
> 
> 2.) is there an optional support for ThreadContextClassLoader scenarios?
> This is often a problem for logging in libraries which are on a shared classpath. Imagine
2 webapps, both using OpenWebBeans as CDI container. One webapp sets the org.apache.webbeans
loglevel to debug, the other wone to WARN ...
> 
> As it currently stands, no, but I have always intended to introduce something to support
that.
> 
> When I wrote the Log4j 2 API it took a stab at creating an abstraction to bind the API
to an implementation. It was only when I built the core that I added the plugin support. Looking
at how it is done it now occurs to me that the plugin support really should move to the API
and be used to bind to the implementation. This would provide the flexibility needed to accomplish
this.
> 
> How much work us that?



This shouldn't be much work at all. I'll probably do it in the next few days.  The only trick
is the context selection criteria and making sure the LoggerContext and configuration are
properly freed when the webapp shuts down. Logback uses JNDI lookups (see http://logback.qos.ch/manual/loggingSeparation.html#ContextJNDISelector)
as well as a Servlet Context Listener. I'll probably do somethnig similar, although I'd prefer
to do it with annotations.

Ralph


Mime
View raw message