diff --git a/jcl-over-slf4j/pom.xml b/jcl-over-slf4j/pom.xml
index e7e7e02e..3e7a210c 100644
--- a/jcl-over-slf4j/pom.xml
+++ b/jcl-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
- * // once during initialization time of your application
- * SLF4JHandler.install(handler);
+ * // call only once during initialization time of your application
+ * SLF4JHandler.install();
*
* // usual pattern: get a Logger and then log a message
* java.util.logging.Logger julLogger = java.util.logging.Logger.getLogger("org.wombat");
diff --git a/log4j-over-slf4j/pom.xml b/log4j-over-slf4j/pom.xml
index 9d2fc71f..eebca7a5 100644
--- a/log4j-over-slf4j/pom.xml
+++ b/log4j-over-slf4j/pom.xml
@@ -5,7 +5,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/osgi-over-slf4j/pom.xml b/osgi-over-slf4j/pom.xml
index c3c05add..acac1b04 100644
--- a/osgi-over-slf4j/pom.xml
+++ b/osgi-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/pom.xml b/pom.xml
index 306e2196..e6ea57e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
pom
SLF4J
diff --git a/slf4j-api/pom.xml b/slf4j-api/pom.xml
index 863214bf..2a5fd548 100644
--- a/slf4j-api/pom.xml
+++ b/slf4j-api/pom.xml
@@ -5,7 +5,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-jcl/pom.xml b/slf4j-jcl/pom.xml
index 70f1059a..97eb1df1 100644
--- a/slf4j-jcl/pom.xml
+++ b/slf4j-jcl/pom.xml
@@ -3,7 +3,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-jdk14/pom.xml b/slf4j-jdk14/pom.xml
index 7f5fea3a..a0a4095d 100644
--- a/slf4j-jdk14/pom.xml
+++ b/slf4j-jdk14/pom.xml
@@ -6,7 +6,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-log4j12/pom.xml b/slf4j-log4j12/pom.xml
index 4f485930..e3497bc7 100644
--- a/slf4j-log4j12/pom.xml
+++ b/slf4j-log4j12/pom.xml
@@ -6,7 +6,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-migrator/pom.xml b/slf4j-migrator/pom.xml
index e9a3d0bf..c58c379f 100644
--- a/slf4j-migrator/pom.xml
+++ b/slf4j-migrator/pom.xml
@@ -7,7 +7,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-nop/pom.xml b/slf4j-nop/pom.xml
index d41a9921..780a7716 100644
--- a/slf4j-nop/pom.xml
+++ b/slf4j-nop/pom.xml
@@ -6,7 +6,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-osgi-integration-test/pom.xml b/slf4j-osgi-integration-test/pom.xml
index 5cc86790..541d2060 100644
--- a/slf4j-osgi-integration-test/pom.xml
+++ b/slf4j-osgi-integration-test/pom.xml
@@ -6,7 +6,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-osgi-test-bundle/pom.xml b/slf4j-osgi-test-bundle/pom.xml
index ad6e2287..0b5607a5 100644
--- a/slf4j-osgi-test-bundle/pom.xml
+++ b/slf4j-osgi-test-bundle/pom.xml
@@ -6,7 +6,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-simple/pom.xml b/slf4j-simple/pom.xml
index 4563ee52..5707b05f 100644
--- a/slf4j-simple/pom.xml
+++ b/slf4j-simple/pom.xml
@@ -3,7 +3,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-site/pom.xml b/slf4j-site/pom.xml
index 8410b5f2..0f8f8233 100644
--- a/slf4j-site/pom.xml
+++ b/slf4j-site/pom.xml
@@ -5,7 +5,7 @@
org.slf4j
slf4j-parent
- 1.5.1
+ 1.5.2
4.0.0
diff --git a/slf4j-site/src/site/images.src/bindings.png b/slf4j-site/src/site/images.src/bindings.png
deleted file mode 100644
index 4021c095..00000000
Binary files a/slf4j-site/src/site/images.src/bindings.png and /dev/null differ
diff --git a/slf4j-site/src/site/images.src/bridging.png b/slf4j-site/src/site/images.src/bridging.png
deleted file mode 100644
index 353e94d2..00000000
Binary files a/slf4j-site/src/site/images.src/bridging.png and /dev/null differ
diff --git a/slf4j-site/src/site/pages/docs.html b/slf4j-site/src/site/pages/docs.html
index 4328050a..bd33e625 100644
--- a/slf4j-site/src/site/pages/docs.html
+++ b/slf4j-site/src/site/pages/docs.html
@@ -27,6 +27,7 @@ prefix='';
The Simple Logging Facade for Java or (SLF4J) is intended to serve as a simple facade for various logging APIs allowing to the end-user to plug in the desired implementation at - deployment time. SLF4J also allows for a gradual migration path away from - Jakarta Commons Logging (JCL). + deployment time. SLF4J also supports a bridging legacy APIs as well as a source code migration tool. +
SLF4J API offers an advanced abstraction of various logging diff --git a/slf4j-site/src/site/pages/log4j-over-slf4j.html b/slf4j-site/src/site/pages/log4j-over-slf4j.html index bdab179a..3feb214d 100644 --- a/slf4j-site/src/site/pages/log4j-over-slf4j.html +++ b/slf4j-site/src/site/pages/log4j-over-slf4j.html @@ -23,80 +23,10 @@ prefix='';
Recent versions of SLF4J ship with a module called - log4j-over-slf4j. It allows log4j users to migrate - existing applications to SLF4J without changing a single line - of code but simply by replacing the log4j.jar file - with log4j-over-slf4j.jar, as described below. -
- -The log4j-over-slf4j module contains replacements of most
- widely used log4j classes, namely
- org.apache.log4j.Category,
- org.apache.log4j.Logger,
- org.apache.log4j.Priority,
- org.apache.log4j.Level,
- org.apache.log4j.MDC, and
- org.apache.log4j.BasicConfigurator. These replacement
- classes redirect all work to their corresponding SLF4J classes.
-
This chapter has been moved elsewhhere.
-To use log4j-over-slf4j in your own application, the first step - is to locate and then to replace log4j.jar with - log4j-over-slf4j.jar. Note that you still need an SLF4J - binding and its dependencies for log4j-over-slf4j to work - properly. -
- -- In most situtations, replacing a jar file is all it takes in - order to migrate from log4j to SLF4J. -
- -Note that as a result of this migration, log4j configuration - files will no longer be picked up. If you need to migrate your - log4j.properties file to logback, the log4j translator - might be of help. For configuring logback, please refer to its manual. -
- -We are happy to report that several applications are - successfully using log4j-over-slf4j in production. -
- - -The log4j-over-slf4j module will not work when the - application calls log4j components that are not present in the - bridge. For example, direct references to log4j appenders, - filters or PropertyConfigurator are not supported by - log4j-over-slf4j. While the number of cases where - log4j-over-slf4j is insufficient is not completely negligible, in - the vast majority of cases where log4j is configured through a - configuration file, be it log4j.properties or - log4j.xml, log4j-over-slf4j is enough in order to migrate - your application to SLF4J. -
- -There overhead of using log4j-over-slf4j instead of log4j - directly is relatively small. Given that log4j-over-slf4j - immediately delegates all work to SLF4J, the CPU overhead should - be negligible, in the order of a few nanoseconds. There - is a memory overhead corresponding to an entry in a hashmap per - logger, which should be usually acceptable even for very large - applications consisting of several thousand loggers. Moreover, if - you choose logback as your underlying logging system, and given - that logback is both much faster and more memory-efficient than - log4j, the gains made by using logback should compensate for the - overhead of using log4j-over-slf4j instead of log4j directly. -
- diff --git a/slf4j-site/src/site/pages/manual.html b/slf4j-site/src/site/pages/manual.html index 7ea17ce1..1e656c11 100644 --- a/slf4j-site/src/site/pages/manual.html +++ b/slf4j-site/src/site/pages/manual.html @@ -61,36 +61,47 @@ prefix='';SLF4J supports multiple logging systems, namely, NOP, - Simple, log4j version 1.2, JDK 1.4 logging, - JCL and logback. The SLF4J distribution ships with several jar - files slf4j-nop.jar, slf4j-simple.jar, - slf4j-log4j12.jar, slf4j-log4j13.jar, - slf4j-jdk14.jar and slf4j-jcl.jar. Each of - these jar files is hardwired at compile-time to use - just one implementation, that is NOP, Simple, log4j version - 1.2, JDK 1.4 logging, and repectively - JCL. As of SLF4J version 1.1.0, all of the - bindings shipped with SLF4J depend on slf4j-api.jar - which must be present on the class path for the binding to - function properly.
+SLF4J supports multiple logging systems, namely, NOP, Simple, + log4j version 1.2, JDK 1.4 logging, JCL and logback. The SLF4J + distribution ships with several jar files + slf4j-nop.jar, slf4j-simple.jar, + slf4j-log4j12.jar, slf4j-log4j13.jar, + slf4j-jdk14.jar and slf4j-jcl.jar. Each of + these jar files is hardwired at compile-time to use + just one implementation, that is NOP, Simple, log4j version 1.2, + JDK 1.4 logging, and repectively JCL. As of SLF4J version 1.1.0, all of the + bindings shipped with SLF4J depend on slf4j-api.jar + which must be present on the class path for the binding to + function properly. The figure below illustrates the + general idea. +
+ ++ + + +
Small applications where configuring a fully-fledged logging systems can be somewhat of an overkill, can drop in - slf4j-api.jar+slf4j-simple.jar instead of a binding for a - fully-fledged logging system.
+ slf4j-api.jar+slf4j-simple.jar instead of a + binding for a fully-fledged logging system. +Authors of widely-distributed components and libraries may code against the SLF4J interface in order to avoid imposing an - logging system on the end-user. At deployment - time, the end-user may choose the desired logging system by inserting the corresponding jar file in her - classpath. This stupid, simple and robust approach avoids many - of the painful bugs associated with dynamic discovery - processes. + logging system on the end-user. At deployment time, the + end-user may choose the desired logging system by inserting + the corresponding jar file in her classpath. This stupid, + simple and robust approach avoids many of the painful bugs + associated with dynamic discovery processes.
As of version 1.4.1, SLF4J supports MDC, or mapped diagnosic context. If the underlying logging system offers MDC @@ -156,80 +166,18 @@ prefix='';
For more information on MDC please see the chapter on MDC in the logback manual. +
- - +This section has been moved elsewhere.
-To ease migration to SLF4J from JCL, recent SLF4J - distributions include the jar file - jcl-over-slf4j.jar. This jar file is intended as a - drop-in replacement for JCL version 1.0.4. It implements the - public API of JCL but using SLF4J underneath, hence the name - "JCL over SLF4J." -
- -Our JCL over SLF4J implementation will allow you to migrate - to SLF4J gradually, especially if some of the libraries your - software depends on continue to use JCL for the foreseeable - future. You can immediately enjoy the benefits of SLF4J's - reliability and preserve backward compatibility at the same - time. Just replace commons-logging.jar with - jcl-over-slf4j.jar. Subsequently, the selection of - the underlying logging system will be done by SLF4J instead of - JCL but without the class loader headaches. The underlying - logging system can be any of NOP, simple, jdk14 logging, log4j - or logback. Any existing dependency on commons-logging - therefore becomes less of an issue. -
- -Some of our users after having switched to SLF4J API - realize that in some contexts the use of JCL is mandatory and - their use of SLF4J can be a problem. For this uncommon but - important case, SLF4J offers a JCL binding, found in the file - slf4j-jcl.jar. The JCL binding will delegate all - logging calls made through SLF4J API to JCL. Thus, if for some - reason an existing application must use JCL, your - part of that application can still code against the SLF4J API - in a manner transparent to the larger application - environment. Your choice of SLF4J API will be invisible to the - rest of the application which can continue to use JCL. -
- -JCL-over-SLF4J, i.e. jcl-over-slf4j.jar, comes - in handy in situations where JCL needs to be supported for - backward compatibility reasons. It can be used to fix problems - associated with JCL, without necessarily adopting the SLF4J - API, a decision which can be deferred to a later time. -
- -On the other hand, slf4j-jcl.jar is useful after you have already adopted the SLF4J API for your component - which needs to be embedded in a larger application environment - where JCL is a formal requirement. Your software component can - still use SLF4J API without disrupting the larger - application. Indeed, slf4j-jcl.jar will delegate all - logging decisions to JCL so that the dependency on SLF4J API - by your component will be transparent to the larger whole.
- -Please note that jcl-over-slf4j.jar and - slf4j-jcl.jar cannot be deployed at the same - time. The former jar file will cause JCL to delegate the - choice of the logging system to SLF4J and the latter jar file - will cause SLF4J to delegate the choice of the logging system - to JCL, resulting in an infinite loop. -
- -| Fail-fast operation | Assuming the appropriate jar file is available on the classpath, under no circumstances will SLF4J cause your @@ -277,19 +225,31 @@ prefix=''; |
| Easy migration path | +|
| Bridging legacy logging APIs |
The implementation of JCL over SLF4J, i.e jcl-over-slf4j.jar, will allow your project to migrate to SLF4J piecemeal, without breaking - compatibility with existing software using JCL. + compatibility with existing software using + JCL. Similarly, log4j-over-slf4j.jar and jul-to-slf4j + modules will allow you to redirect log4j and + respectively java.util.logging calls to SLF4J. |
| Migrate your source code | +The slf4j-migrator utility + can help you migrate your source to use SLF4J. + | +
| Support for formated log messages | All SLF4J adapters support formated log messages with diff --git a/slf4j-site/src/site/pages/templates/footer.js b/slf4j-site/src/site/pages/templates/footer.js index dc416c0b..f4d7059a 100644 --- a/slf4j-site/src/site/pages/templates/footer.js +++ b/slf4j-site/src/site/pages/templates/footer.js @@ -1,5 +1,5 @@ document.write('') diff --git a/slf4j-site/src/site/resources/images/bindings.png b/slf4j-site/src/site/resources/images/bindings.png index d826a8a9..4021c095 100644 Binary files a/slf4j-site/src/site/resources/images/bindings.png and b/slf4j-site/src/site/resources/images/bindings.png differ diff --git a/slf4j-site/src/site/resources/images/bridging.png b/slf4j-site/src/site/resources/images/bridging.png index 622a0f08..353e94d2 100644 Binary files a/slf4j-site/src/site/resources/images/bridging.png and b/slf4j-site/src/site/resources/images/bridging.png differ |