[slf4j-user] Using slf4j in a library project

Ceki Gülcü listid at qos.ch
Wed Jan 31 23:52:48 CET 2007


The issue was discussed in a somewhat abstract way durin july 2006 [1].

[1] http://www.slf4j.org/pipermail/dev/2006-July/000623.html

Practically speaking, as a designer of a library you need to ship both 
slf4j-api and an implementation say slf4j-simple.jar and let the end-user 
replace the implementation if he or she decides to do so. Depending on your 
distribution mechanism, allowing the user to replace the implementation 
might be more or less difficult.

At 10:23 AM 1/31/2007, you wrote:
>Hello,
>
>I have a question about the usage of slf4j in a library project. I
>wonder how the library can depend on slf4j-api only.
>As the slf4j-documentation suggest the standard usage pattern is
>
>  1: import org.slf4j.Logger;
>  2: import org.slf4j.LoggerFactory;
>  3:
>  4: public class Wombat {
>  5:
>  6:   final Logger logger = LoggerFactory.getLogger(Wombat.class);
>
>The problem is that already this does not only depend on slf4j-api but
>on some real implementation because of the missing of LoggerFactory in
>slf4j-api.jar.
>
>Regards
>ThoMo

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




More information about the slf4j-user mailing list