[logback-user] LoggerFactory question

Eric Crahen eric.crahen.lists at gmail.com
Fri Feb 9 19:04:18 CET 2007


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.

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.


-- 

- Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20070209/437b0b87/attachment.htm 


More information about the Logback-user mailing list