[logback-user] LoggerFactory question

Ceki Gülcü listid at qos.ch
Fri Feb 9 19:12:48 CET 2007


At 07:04 PM 2/9/2007, Eric Crahen wrote:
>I'm using Logback, but I build my code only against the SLF4J api. One 
>thing that I found strange was that LoggerFactory is not actually part of 
>the SLF4J api.

Correct.

>This poses a challenge to me, because I will need to depend on some 
>arbitrary implementation of an SLF4J api (probably the nop one) in order 
>to build my code. Then at deployment time, I need to remove that 
>slf4j-noop dependency and swap in a different one. The reason this is 
>tricky for me is that the deployment process I use currently is 
>(compile-time dependencies + extra runtime dependencies). The style in 
>slf4j creates a ((compile-time dependencies - slf4j-nop) + runtime 
>dependencies). This process is part of a larger overarching system that my 
>organization happens to use, so bucking the trend isn't too fun - though 
>possible.
>
>Also, it seems like all these implementations of LoggerFactory  are pretty 
>much identical. I think that these could be consolidated into a single 
>LoggerFactory in the slf4-api package. This package could make use of the 
>ServiceProvider mechanism thats present in Java 4 & 5 + standard in Java 6 
>to load the underlying Logger implementations. What do you think? I could 
>probably contribute a patch that would demonstrate how this might work.

Hi Eric,

This issue came up previously and will continue to haunt us for the 
foreseeable future. I'd wouldn't be exaggerating if I said that I'd be very 
much interested in your contribution.

I am CCing the slf4j-dev list as well. You might want to submit your 
proposal there instead.

>- Eric

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch




More information about the Logback-user mailing list