+ Detected both log4j-over-slf4j.jar
+ AND slf4j-log4j12.jar on the class path, preempting
+ StackOverflowError
.
+
+
+ The purpose of slf4j-log4j12 module is to delegate or redirect
+ calls made to an SLF4J logger to log4j. The purpose of the
+ log4j-over-slf4j module is to redirect calls made to a log4j
+ logger to SLF4J. If both slf4j-log4j12.jar and
+ log4j-over-slf4j.jar are present on the class path, a
+ StackOverflowError
will inevitably occur immediately
+ after the first invocation of an SLF4J or a log4j logger.
+
Here is how the exception might look like:
+ +Exception in thread "main" java.lang.StackOverflowError + at java.util.Hashtable.containsKey(Hashtable.java:306) + at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:36) + at org.apache.log4j.LogManager.getLogger(LogManager.java:39) + at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) + at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249) + at org.apache.log4j.Category.<init>(Category.java:53) + at org.apache.log4j.Logger..<init>(Logger.java:35) + at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39) + at org.apache.log4j.LogManager.getLogger(LogManager.java:39) + at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) + at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249) + at org.apache.log4j.Category..<init>(Category.java:53) + at org.apache.log4j.Logger..<init>(Logger.java:35) + at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39) + at org.apache.log4j.LogManager.getLogger(LogManager.java:39) + subsequent lines omitted...+ +
As of SLF4J version 1.5.11, the code preempts the inevitable
+ stack overflow error by throwing an exception with details about
+ the actual cause of the problem. This is deemed to be better than
+ leaving the user wondering about the reasons of the
+ StackOverflowError
.
+
For more background on this topic see Bridging legacy APIs. +
+ + + + +
+ Detected
+ both jcl-over-slf4j.jar AND slf4j-jcl.jar on the class path,
+ preempting StackOverflowError
.
+
+
+ The purpose of slf4j-jcl module is to delegate or redirect
+ calls made to an SLF4J logger to jakarta commons logging
+ (JCL). The purpose of the jcl-over-slf4j module is to redirect
+ calls made to a JCL logger to SLF4J. If both
+ slf4j-jcl.jar and jcl-over-slf4j.jar are present
+ on the class path, then a StackOverflowError
will
+ inevitably occur immediately after the first invocation of an
+ SLF4J or a JCL logger.
+
Here is how the exception might look like:
+ +Exception in thread "main" java.lang.StackOverflowError + at java.lang.String.hashCode(String.java:1482) + at java.util.HashMap.get(HashMap.java:300) + at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:67) + at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249) + at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) + at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:289) + at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69) + at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249) + at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) + subsequent lines omitted...+ + +
As of SLF4J version 1.5.11, the code preempts the inevitable
+ stack overflow error by throwing an exception with details about
+ the actual cause of the problem. This is deemed to be better than
+ leaving the user wondering about the reasons of the
+ StackOverflowError
.
+
For more background on this topic see Bridging legacy APIs. +
+ + +
Failed to load class
diff --git a/slf4j-site/src/site/pages/legacy.html b/slf4j-site/src/site/pages/legacy.html
index a5ba376..fa8d54d 100644
--- a/slf4j-site/src/site/pages/legacy.html
+++ b/slf4j-site/src/site/pages/legacy.html
@@ -101,10 +101,10 @@
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.
+ 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.
@@ -184,9 +184,10 @@
The presence of slf4j-logj12.jar, that is the log4j
binding for SLF4J, will force all SLF4J calls to be delegated to
log4j. The presence of log4j-over-slf4j.jar will in turn
- delegate all log4j API calls to their SLF4J equivalents. If both are
- present simultaneously, slf4j calls will be delegated to log4j, and
- log4j calls redirected to SLF4j, resulting in an endless loop.
+ delegate all log4j API calls to their SLF4J equivalents. If both
+ are present simultaneously, slf4j calls will be delegated to
+ log4j, and log4j calls redirected to SLF4j, resulting in an endless loop.
JUL to SLF4J
diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html
index 8b04327..b5a8c71 100644
--- a/slf4j-site/src/site/pages/news.html
+++ b/slf4j-site/src/site/pages/news.html
@@ -27,7 +27,20 @@
- March xx, 2010 - Release of SLF4J 1.5.11
+ February 25th, 2010 - Release of SLF4J 1.5.11
+
+
+ Users yet unfamiliar with SLF4J sometimes unknowingly place both
+ log4j-over-slf4j.jar and slf4j-log4j12.jar
+ simultanously on the class path causing stack overflow
+ errors. Simultaneously placing both jcl-over-slf4j.jar and
+ slf4j-jcl.jar on the class path, is another occurrence of
+ the same general problem. As of this version, SLF4J preempts the
+ inevitable stack overflow error by throwing an exception with
+ details about the actual cause of the problem. This is deemed to be
+ better than leaving the user wondering about the reasons of the
+ StackOverflowError
.
+
Fixed bug
168. In case log4j-over-slf4j is used and a logback appender
-----------------------------------------------------------------------
Summary of changes:
integration/pom.xml | 2 +-
jcl-over-slf4j/pom.xml | 2 +-
jcl104-over-slf4j/pom.xml | 2 +-
jul-to-slf4j/pom.xml | 2 +-
log4j-over-slf4j/pom.xml | 2 +-
.../src/main/java/org/apache/log4j/Category.java | 2 +
.../java/org/apache/log4j/Log4jLoggerFactory.java | 22 ++++-
osgi-over-slf4j/pom.xml | 2 +-
pom.xml | 2 +-
slf4j-api/pom.xml | 2 +-
.../src/main/java/org/slf4j/LoggerFactory.java | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-ext/pom.xml | 2 +-
slf4j-jcl/pom.xml | 2 +-
.../main/java/org/slf4j/impl/JCLLoggerFactory.java | 19 ++++
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-jdk14/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-log4j12/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-migrator/pom.xml | 2 +-
slf4j-nop/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-osgi-integration-test/pom.xml | 2 +-
slf4j-osgi-test-bundle/pom.xml | 2 +-
slf4j-simple/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-site/pom.xml | 2 +-
slf4j-site/src/site/pages/codes.html | 110 ++++++++++++++++++-
slf4j-site/src/site/pages/legacy.html | 15 ++--
slf4j-site/src/site/pages/news.html | 15 +++-
31 files changed, 193 insertions(+), 40 deletions(-)
hooks/post-receive
--
SLF4J: Simple Logging Facade for Java
From bugzilla-daemon at pixie.qos.ch Thu Feb 25 12:52:00 2010
From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch)
Date: Thu, 25 Feb 2010 12:52:00 +0100 (CET)
Subject: [slf4j-dev] [Bug 169] Better introspection into logging setup
In-Reply-To:
Message-ID: <20100225115200.C4649314C3E@pixie.qos.ch>
http://bugzilla.slf4j.org/show_bug.cgi?id=169
--- Comment #1 from Ceki Gulcu 2010-02-25 12:52:00 ---
Hello Joachim,
SLF4J loggers cannot be configured. So I am afraid I don't see what you are
talking about. What do you mean by configuring an SLF4J logger?
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
From ceki at qos.ch Thu Feb 25 12:56:08 2010
From: ceki at qos.ch (=?ISO-8859-1?Q?Ceki_G=FClc=FC?=)
Date: Thu, 25 Feb 2010 12:56:08 +0100
Subject: [slf4j-dev] Release of SLF4J version 1.5.11
Message-ID: <4B866558.7010406@qos.ch>
Hello all,
I am happy to announce the immediate availability of SLF4J version
1.5.11 consisting of bug fixes and minor enhancements. It is totally
compatible with SLF4J version 1.5.10.
Please refer to the the news page for precise details.
http://www.slf4j.org/news.html
You can download SLF4J, including full source code, class files and
documentation on our download page, shown below.
http://www.slf4j.org/download.html
You can receive SLF4J related announcements by subscribing to the
SLF4J announce mailing list. To subscribe to QOS.ch announce list,
please visit the following URL.
http://www.qos.ch/mailman/listinfo/announce
--
Ceki G?lc?
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
From bugzilla-daemon at pixie.qos.ch Thu Feb 25 13:08:15 2010
From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch)
Date: Thu, 25 Feb 2010 13:08:15 +0100 (CET)
Subject: [slf4j-dev] [Bug 169] Better introspection into logging setup
In-Reply-To:
Message-ID: <20100225120815.6BCB0314C58@pixie.qos.ch>
http://bugzilla.slf4j.org/show_bug.cgi?id=169
--- Comment #2 from Joachim Durchholz 2010-02-25 13:08:15 ---
> SLF4J loggers cannot be configured. So I am afraid I don't see what you are
> talking about. What do you mean by configuring an SLF4J logger?
I mean the configuration as found in logback.xml.
I had assumed it can be changed after loading the configuration.
Of course, if no such changes are possible, then there's not need for events
that relay the changes :)
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
From bugzilla-daemon at pixie.qos.ch Thu Feb 25 13:16:32 2010
From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch)
Date: Thu, 25 Feb 2010 13:16:32 +0100 (CET)
Subject: [slf4j-dev] [Bug 169] Better introspection into logging setup
In-Reply-To:
Message-ID: <20100225121632.6F5FB314C59@pixie.qos.ch>
http://bugzilla.slf4j.org/show_bug.cgi?id=169
--- Comment #3 from Ceki Gulcu 2010-02-25 13:16:32 ---
Logback loggers can be dynamically configured while SLF4J loggers cannot. This
keeps the SLF4J API simple. I suggest we take this to the logback-dev mailing
list.
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
From bugzilla-daemon at pixie.qos.ch Thu Feb 25 15:32:14 2010
From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch)
Date: Thu, 25 Feb 2010 15:32:14 +0100 (CET)
Subject: [slf4j-dev] [Bug 168] Category.log(String FQCN, Priority p,
Object msg, Throwable t) method throws UnsupportedOperationException
In-Reply-To:
Message-ID: <20100225143214.D873A314C5A@pixie.qos.ch>
http://bugzilla.slf4j.org/show_bug.cgi?id=168
Ceki Gulcu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Ceki Gulcu 2010-02-25 15:32:14 ---
Fixed in SLF4J 1.5.11
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
From bugzilla-daemon at pixie.qos.ch Thu Feb 25 15:32:29 2010
From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch)
Date: Thu, 25 Feb 2010 15:32:29 +0100 (CET)
Subject: [slf4j-dev] [Bug 167] Document StackOverflow Exception when an
infinite delegation cycle occurs
In-Reply-To:
Message-ID: <20100225143229.79C2F314C5A@pixie.qos.ch>
http://bugzilla.slf4j.org/show_bug.cgi?id=167
Ceki Gulcu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Ceki Gulcu 2010-02-25 15:32:29 ---
Fixed in SLF4J 1.5.11
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
From git-noreply at pixie.qos.ch Thu Feb 25 15:58:32 2010
From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo)
Date: Thu, 25 Feb 2010 15:58:32 +0100 (CET)
Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch,
master, updated. v1.5.9.RC1-24-g4901ff5
Message-ID: <20100225145832.5D346314C63@pixie.qos.ch>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SLF4J: Simple Logging Facade for Java".
The branch, master has been updated
via 4901ff5a22177bf6165beabde79d3fe135e9dd43 (commit)
from dae55b822906cbb5b701e6f58199e9b50c0e2df8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=4901ff5a22177bf6165beabde79d3fe135e9dd43
http://github.com/ceki/slf4j/commit/4901ff5a22177bf6165beabde79d3fe135e9dd43
commit 4901ff5a22177bf6165beabde79d3fe135e9dd43
Author: Ceki Gulcu
Date: Thu Feb 25 15:58:07 2010 +0100
- minor edits in the docs
diff --git a/slf4j-site/src/site/pages/docs.html b/slf4j-site/src/site/pages/docs.html
index 5d5dc62..d1fc77c 100644
--- a/slf4j-site/src/site/pages/docs.html
+++ b/slf4j-site/src/site/pages/docs.html
@@ -65,7 +65,8 @@
- SLF4J in 10 slides, by Ceki Gülcü
+ JUnit 4 Test Logging Tips using
+ SLF4J, by Ceki Gülcü
@@ -84,6 +85,10 @@
Version 99 Does Not Exist
, by Erik van Oosten
+
StackOverflowError
.
+ slf4j-jcl.jar
diff --git a/slf4j-site/src/site/pages/manual.html b/slf4j-site/src/site/pages/manual.html index 6d1b1dc..aebe651 100644 --- a/slf4j-site/src/site/pages/manual.html +++ b/slf4j-site/src/site/pages/manual.html @@ -131,8 +131,7 @@ public class HelloWorld {Embedded components such as libraries do not need and - should not configure the underlying logging system. They - invoke SLF4J to log but should let the end-user configure the - logging environment. When embedded components try to configure - logging on their own, they often override the end-user's - wishes. At the end of the day, it is the end-user who has to - read the logs and process them. She should be the person to - decide how she wants her logging configured. +
Embedded components such as libraries not only do not need + to configure the underlying logging framework, they really + should not do so. They should invoke SLF4J to log but should + let the end-user configure the logging environment. When + embedded components try to configure logging on their own, they + often override the end-user's wishes. At the end of the day, it + is the end-user who has to read the logs and process them. She + should be the person to decide how she wants her logging + configured.
This + question pops up whenever a software project reaches a point + where it needs to devise a logging strategy. +
+ +Let Wombat be a software library with very few + dependencies. If SLF4J is chosen as Wombat's logging API, then a + new dependency on slf4j-api.jar will be added to + Wombat's list of dependencies. Given that writing a logging + wrapper does not seem that hard, some developers will be tempted + to wrap SLF4J and link with it only if it is already present on + the classpath, making SLF4J an optional dependency of Wombat. In + addition to solving the dependency problem, the wrapper will + isolate Wombat from SLF4J;s API ensuring that logging in Wombat + is future-proof. +
+ +On the other hand, any SLF4J-wrapper by definition depends on + SLF4J. It is bound to have the same general API. If in the + future a new and significantly different logging API comes + along, code that uses the wrapper will be equally difficult to + migrate to the new API as code that used SLF4J directly. Thus, + the wrapper is not likely to future-proof your code, but to make + it heavier by adding an additional indirection on top SLF4J + which is an indirection in itself. +
+ +While one can come up with a seemingly working SLF4J-wrapper + within hours, many small technical issues will emerge over time + which Wombat developers will have to deal with. Note that SLF4J + has evolved over several years and has 170 bug reports filed + against it.
+ +It is reasonable to assume that in most projects Wombat will + be one dependency among many. If each library had its own + logging wrapper, then each wrapper would presumably need to be + configured separately. Thus, instead of having to deal with one + logging framework, namely SLF4J, the user of Wombat would have + to detail with Wombat's logging wrapper as well. The problem + will be compounded by each framework that comes up with its own + wrapper in order to make SLF4J optional. (Configuring 5 + different logging wrappers is not exactly exciting nor + endearing.) +
+ +For this reason, developers of frameworks should resist the + temptation to write their own logging wrapper. Not only is it a + waste of time of the developer, it will actually make life more + difficult for the users of said frameworks. +
+Thus, as far as your users are concerned you are exporting slf4j-api as a transitive dependency of your library, but not - any SLF4J-binding or an underlying logging system. + any SLF4J-binding or any underlying logging system.
----------------------------------------------------------------------- Summary of changes: slf4j-site/src/site/pages/faq.html | 93 ++++++++++++++++++++++++++++++++---- 1 files changed, 84 insertions(+), 9 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java