[logback-user] Minimal library dependency for logback implementation of RequestLogImpl

Ceki Gulcu ceki at qos.ch
Thu Jan 22 19:11:32 CET 2009


Hello Russell,

The logback projects consists of 3 modules: logback-core, logback-classic and 
logback-access. There is also the logback-audit module but which is commercial 
(not open-source). All modules depend on logback-core.

Logback-access module depends on logback-core. It integrates with Tomcat and 
Jetty. So it requires any the two to be useful.

Logback-classic module depends on logback-core and on slf4j-api. The logback 
distribution bundles slf4j-api.jar under logback-examples/lib. However, your can 
obtain slf4j from http://www.slf4j.org/download.html

The pom.xml file you mention has a *dependencyManagement* section which declares 
slf4j. However, the dependencyManagement is used to fix the *version* of a 
dependency for all modules. It does *not* declare a dependency. In 
logback-classic/pom.xml there is indeed a dependency declaration on 
log4j-over-slf4j but which is in the *test* scope. It is only used for testing 
purposes. In other words, you don't need log4j to use logback.

You should not confuse logback-access and logback-classic. There serve different 
purposes. To answer your question, logback-access does not depend on SLF4J. (You 
are only interested in logback-access, right?)

HTH,

Russell E Glaue wrote:
> Really?
> 
> http://www.slf4j.org/
> -
> SLF4J API offers an advanced abstraction of various logging systems, including
> ... logback. ...
> Logging systems can either choose to implement the the SLF4J interfaces
> directly, e.g. logback or ...
> -
> 
> So what then is the relationship between logback and slf4j ?
> 
> When my team has investigated the POM files for logback, we see dependency on
> log4j libraries.
> 
> The latest POM in trunk show a dependency on slf4j 1.5.6
> http://svn.qos.ch/viewvc/logback/trunk/pom.xml?revision=2114
> -
> ...
> <properties>
>> 	<!--
>  slf4j.version property is used below and in setClasspath.cmd
> -->
> <slf4j.version>1.5.6</slf4j.version>
> <consolePlugin.version>1.1.0</consolePlugin.version>
> </properties>
> ...
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-api</artifactId>
> <version>${slf4j.version}</version>
> </dependency>
> ...
> -
> 
> Are the slf4j libraries compiled into and bundled with the logback distribution?
> 
> -RG
> 


-- 
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