From 446d17451bbf74c7f56788f94165b584cf80a835 Mon Sep 17 00:00:00 2001
From: Ceki Gulcu The Simple Logging Facade for Java or (SLF4J) serves as a simple
- facade or abstraction for various logging frameworks, e.g.
- java.util.logging, log4j and logback, allowing the end user to plug
- in the desired logging framework at deployment
+ The Simple Logging Facade for Java (or SLF4J) serves as a simple
+ facade or abstraction for various logging frameworks
+ (e.g. java.util.logging, logback, log4j) allowing the end user to
+ plug in the desired logging framework at deployment
time. Before you start using SLF4J, we highly recommend that you read
@@ -44,7 +44,7 @@ In case you wish to migrate your Java source files to SLF4J,
consider our migrator tool which can
- migrate your project into SLF4J in minutes.Simple Logging Facade for Java (SLF4J)
- Simple Logging Facade for Java (SLF4J)
In case an externally-maintained component you depend on uses a logging API other than SLF4J, such as commons logging, log4j or @@ -97,6 +97,7 @@
The Simple Logging Facade for Java or (SLF4J) serves as a - simple facade or abstraction for various logging frameworks, such - as java.util.logging, log4j and logback. SLF4J allows the end-user - to plug in the desired logging framework at deployment - time. Note that SLF4J-enabling your library/application implies - the addition of only a single mandatory dependency, namely +
The Simple Logging Facade for Java (SLF4J) serves as a simple + facade or abstraction for various logging frameworks, such as + java.util.logging, logback and log4j. SLF4J allows the end-user to + plug in the desired logging framework at deployment time. + Note that SLF4J-enabling your library/application implies the + addition of only a single mandatory dependency, namely slf4j-api-${project.version}.jar.
since 1.6.0 If no binding is found on the @@ -43,8 +43,8 @@
Object[]
. Thus, the Logger interface generated by the
- compiler is indistinguishable in 1.7.0 from its 1.6.0
- counterpart. It follows that SLF4J version 1.7.0 is totally 100%
+ compiler is indistinguishable in 1.7.x from its 1.6.x
+ counterpart. It follows that SLF4J version 1.7.x is totally 100%
no-ifs-or-buts compatible with SLF4J version 1.6.x.
@@ -86,8 +86,8 @@ This warning is printed because no slf4j binding could be found on your class path.
-The warning will disappear as soon as you add a binding to - your class path. Assuming you add +
The warning will disappear as soon as you add a binding to your class path. Assuming you add slf4j-simple-${project.version}.jar so that your class path contains:
@@ -177,18 +177,25 @@ch.qos.logback.classic.Logger
class is a
+ direct implementation of SLF4J's
+ org.slf4j.Logger
interface. Thus, using SLF4J
+ in conjunction with logback involves strictly zero memory and
+ computational overhead.
+
+ There are also SLF4J bindings external to the SLF4J project,
- e.g. logback which
- implements SLF4J natively. Logback's
-
- ch.qos.logback.classic.Logger
class is a direct
- implementation of SLF4J's
-
- org.slf4j.Logger
interface. Thus, using SLF4J
- in conjunction with logback involves strictly zero memory and
- computational overhead.
+
@@ -233,13 +240,12 @@
Authors of widely-distributed components and libraries may code against the SLF4J interface in order to avoid imposing an - logging framework on the end-user of the component or library. - Thus, the end-user may choose the desired logging framework at - deployment time by inserting the corresponding slf4j binding on - the classpath, which may be changed later by replacing an - existing binding with another on the class path and restarting - the application. This approach has proven to be simple and very - robust. + logging framework on their end-user. Thus, the end-user may + choose the desired logging framework at deployment time by + inserting the corresponding slf4j binding on the classpath, + which may be changed later by replacing an existing binding with + another on the class path and restarting the application. This + approach has proven to be simple and very robust.
As of SLF4J version 1.6.0, if no binding is found on @@ -261,18 +267,24 @@
Please note that embedded components such as libraries or - frameworks should not declare a dependency on any SLF4J binding - but only depend on slf4j-api. SLF4J usage in embedded - components is also discussed in the FAQ in relation with Basic rule Embedded components + such as libraries or frameworks should not declare a dependency + on any SLF4J binding but only depend on slf4j-api. When a + library declares a transitive dependency on a specific binding, + that binding is imposed on the end-user negating the purpose of + SLF4J. Note that declaring a non-transitve dependecy on a + binding, for example for testing, does not affect the + end-user.
+ +SLF4J usage in embedded components is also discussed in the + FAQ in relation with logging configuration, dependency reduction and testing.
+Given Maven's transitive dependency rules, for "regular"
projects (not libraries or frameworks) declaring logging
dependencies can be accomplished with a single dependency
From c2bf4536bb6ef048e6d665d5c0f5b12e74ddda41 Mon Sep 17 00:00:00 2001
From: Ceki Gulcu The Simple Logging Facade for Java (or SLF4J) serves as a simple
+ The Simple Logging Facade for Java (SLF4J) serves as a simple
facade or abstraction for various logging frameworks
(e.g. java.util.logging, logback, log4j) allowing the end user to
plug in the desired logging framework at deployment
Simple Logging Facade for Java (SLF4J)
-