From bugzilla-daemon at pixie.qos.ch Tue Feb 2 20:33:19 2010 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Tue, 2 Feb 2010 20:33:19 +0100 (CET) Subject: [slf4j-dev] [Bug 166] please add OSGI informations to jul-to-slf4j-1.5.10.jar In-Reply-To: Message-ID: <20100202193319.80DAD9A1CC@pixie.qos.ch> http://bugzilla.slf4j.org/show_bug.cgi?id=166 DavidT changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |djt69 at comcast.net -- 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 Mon Feb 8 19:44:12 2010 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Mon, 8 Feb 2010 19:44:12 +0100 (CET) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.9.RC1-18-g94da9e9 Message-ID: <20100208184413.3F37A31461B@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 94da9e9b2c3a5df7438e00b40b25bf07d37c86f8 (commit) from 6d5506bcda25187d0cc1ad7319e07713fa2e164e (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=94da9e9b2c3a5df7438e00b40b25bf07d37c86f8 http://github.com/ceki/slf4j/commit/94da9e9b2c3a5df7438e00b40b25bf07d37c86f8 commit 94da9e9b2c3a5df7438e00b40b25bf07d37c86f8 Author: Ceki Gulcu Date: Mon Feb 8 19:39:47 2010 +0100 - added links to support and training - removed links to stale projects (x4juli and simple-log) diff --git a/slf4j-site/src/site/pages/templates/footer.js b/slf4j-site/src/site/pages/templates/footer.js index 8305159..ce67889 100644 --- a/slf4j-site/src/site/pages/templates/footer.js +++ b/slf4j-site/src/site/pages/templates/footer.js @@ -10,7 +10,7 @@ document.write(' ') //document.write(' alt="Valid XHTML 1.0 Transitional" height="31" width="88" />') document.write(' ') -document.write('Copyright © 2004-2009 QOS.ch') +document.write('Copyright © 2004-2010 QOS.ch') document.write('') document.write('') diff --git a/slf4j-site/src/site/pages/templates/left.js b/slf4j-site/src/site/pages/templates/left.js index 510ea40..276d5de 100644 --- a/slf4j-site/src/site/pages/templates/left.js +++ b/slf4j-site/src/site/pages/templates/left.js @@ -2,23 +2,25 @@ document.write(' diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html index 924b058..8b04327 100644 --- a/slf4j-site/src/site/pages/news.html +++ b/slf4j-site/src/site/pages/news.html @@ -25,6 +25,19 @@ announce mailing list.

+
+ +

March xx, 2010 - Release of SLF4J 1.5.11

+ +

Fixed bug + 168. In case log4j-over-slf4j is used and a logback appender + requires a third party library which depends on log4j, the + log(String FQCN, Priority p, Object msg, Throwable t) + method in log4j-over-slf4j's Categotry class would throw an + UnsupportedOperationException. Problem reported by Seth + Call.

+ +

December 3rd, 2009 - Release of SLF4J 1.5.10

----------------------------------------------------------------------- Summary of changes: .../src/main/java/org/apache/log4j/Category.java | 21 +--- slf4j-site/src/site/pages/index.html | 104 ++++++++++++++++++++ slf4j-site/src/site/pages/news.html | 13 +++ 3 files changed, 123 insertions(+), 15 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java From bugzilla-daemon at pixie.qos.ch Thu Feb 25 12:43:48 2010 From: bugzilla-daemon at pixie.qos.ch (bugzilla-daemon at pixie.qos.ch) Date: Thu, 25 Feb 2010 12:43:48 +0100 (CET) Subject: [slf4j-dev] [Bug 169] New: Better introspection into logging setup Message-ID: http://bugzilla.slf4j.org/show_bug.cgi?id=169 Summary: Better introspection into logging setup Product: SLF4J Version: 1.5.x Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P3 Component: Implementations AssignedTo: slf4j-dev at qos.ch ReportedBy: jo at durchholz.org I'd like to - have a way to enumerate all SLF4J loggers configured, and - get an event whenever any SLF4J logger has its configuration changed. USE CASE: I could improve SLF4JBridgeHandler with that. I have a situation where I need to set j.u.l. logging to ALL for some loggers to get the information I want, and WARN for other loggers to keep performance to acceptable levels. Currently, I'm forced to configure both slf4j *and* j.u.l. This is error-prone because I have to keep redundant logging configurations, and because the logging levels do not map 1:1. With the enumeration, I could initialize a j.u.l. logger for every configured slf4j logger, at a compatible logging level. With the events, I could keep the j.u.l. configuration in sync with the slf4j configuration. HELPING WITH THE WORK I can contribute the code, but I can't decide where in SLF4J's architecture it should go. -- 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 12:45:43 2010 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Thu, 25 Feb 2010 12:45:43 +0100 (CET) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.9.RC1-23-gdae55b8 Message-ID: <20100225114543.33E2E314BC9@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 dae55b822906cbb5b701e6f58199e9b50c0e2df8 (commit) from 99c9eb8a756df79e94234f00a348b0ee6222098e (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=dae55b822906cbb5b701e6f58199e9b50c0e2df8 http://github.com/ceki/slf4j/commit/dae55b822906cbb5b701e6f58199e9b50c0e2df8 commit dae55b822906cbb5b701e6f58199e9b50c0e2df8 Author: Ceki Gulcu Date: Thu Feb 25 12:42:32 2010 +0100 - preparing release 1.5.11 - added code to detect the simultaneous presence of both log4j-over-slf4j.jar and slf4j-log4j12.jar. See also http://slf4j.org/codes.html#log4jDelegationLoop - added code to detect the simultaneous presence of both jcl-over-slf4j.jar and slf4j-jcl.jar. See also http://slf4j.org/codes.html#jclDelegationLoop - Fixed http://bugzilla.slf4j.org/show_bug.cgi?id=168 diff --git a/integration/pom.xml b/integration/pom.xml index b5e2ef7..baff429 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/jcl-over-slf4j/pom.xml b/jcl-over-slf4j/pom.xml index cac58f7..0d67bbb 100644 --- a/jcl-over-slf4j/pom.xml +++ b/jcl-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/jcl104-over-slf4j/pom.xml b/jcl104-over-slf4j/pom.xml index 5ce0a74..f8f8d4e 100644 --- a/jcl104-over-slf4j/pom.xml +++ b/jcl104-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/jul-to-slf4j/pom.xml b/jul-to-slf4j/pom.xml index 2bf3d27..a5b759b 100644 --- a/jul-to-slf4j/pom.xml +++ b/jul-to-slf4j/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/log4j-over-slf4j/pom.xml b/log4j-over-slf4j/pom.xml index 9cd2586..2f6d2d3 100644 --- a/log4j-over-slf4j/pom.xml +++ b/log4j-over-slf4j/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java index 279111e..0d5d765 100644 --- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java +++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java @@ -45,6 +45,8 @@ public class Category { protected org.slf4j.Logger slf4jLogger; private org.slf4j.spi.LocationAwareLogger locationAwareLogger; + + private static Marker FATAL_MARKER = MarkerFactory.getMarker("FATAL"); Category(String name) { diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java index fb3a70e..d8d0ad7 100644 --- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java +++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java @@ -18,6 +18,8 @@ package org.apache.log4j; import java.util.Hashtable; +import org.slf4j.helpers.Util; + /** * This class is a factory that creates and maintains org.apache.log4j.Loggers * wrapping org.slf4j.Loggers. @@ -32,12 +34,30 @@ class Log4jLoggerFactory { // String, Logger private static Hashtable log4jLoggers = new Hashtable(); + private static final String LOG4J_DELEGATION_LOOP_URL = "http://www.slf4j.org/codes.html#log4jDelegationLoop"; + + // check for delegation loops + static { + try { + Class.forName("org.slf4j.impl.Log4jLoggerFactory"); + String part1 = "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. "; + String part2 = "See also " + LOG4J_DELEGATION_LOOP_URL + + " for more details."; + + Util.reportFailure(part1); + Util.reportFailure(part2); + throw new IllegalStateException(part1 + part2); + } catch (ClassNotFoundException e) { + // this is the good case + } + } + public static synchronized Logger getLogger(String name) { if (log4jLoggers.containsKey(name)) { return (org.apache.log4j.Logger) log4jLoggers.get(name); } else { Logger log4jLogger = new Logger(name); - + log4jLoggers.put(name, log4jLogger); return log4jLogger; } diff --git a/osgi-over-slf4j/pom.xml b/osgi-over-slf4j/pom.xml index ff81748..84197ba 100644 --- a/osgi-over-slf4j/pom.xml +++ b/osgi-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/pom.xml b/pom.xml index b0514fb..192f5e8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 pom SLF4J diff --git a/slf4j-api/pom.xml b/slf4j-api/pom.xml index e93733d..c272650 100644 --- a/slf4j-api/pom.xml +++ b/slf4j-api/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java index 6dd10e4..068d3df 100644 --- a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java +++ b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java @@ -85,7 +85,7 @@ public final class LoggerFactory { * compatibility. Thus, 1.5.7-SNAPSHOT, 1.5.7.RC0 are compatible with 1.5.7. */ static private final String[] API_COMPATIBILITY_LIST = new String[] { - "1.5.5", "1.5.6", "1.5.7", "1.5.8", "1.5.9", "1.5.10" }; + "1.5.5", "1.5.6", "1.5.7", "1.5.8", "1.5.9", "1.5.10", "1.5.11" }; // private constructor prevents instantiation private LoggerFactory() { diff --git a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 89b97da..169b747 100644 --- a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -61,7 +61,7 @@ public class StaticLoggerBinder { * The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; // !final + public static String REQUESTED_API_VERSION = "1.5.11"; // !final private StaticLoggerBinder() { throw new UnsupportedOperationException("This code should have never made it into the jar"); diff --git a/slf4j-ext/pom.xml b/slf4j-ext/pom.xml index 636f9b0..8c16a11 100644 --- a/slf4j-ext/pom.xml +++ b/slf4j-ext/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-jcl/pom.xml b/slf4j-jcl/pom.xml index edaaa0a..088560b 100644 --- a/slf4j-jcl/pom.xml +++ b/slf4j-jcl/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java b/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java index fddaf91..c3ce664 100644 --- a/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java +++ b/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java @@ -39,6 +39,7 @@ import java.util.Map; import org.apache.commons.logging.LogFactory; import org.slf4j.ILoggerFactory; import org.slf4j.Logger; +import org.slf4j.helpers.Util; /** * JCLLoggerFactory is an implementation of {@link ILoggerFactory} returning the @@ -48,6 +49,24 @@ import org.slf4j.Logger; */ public class JCLLoggerFactory implements ILoggerFactory { + private static final String JCL_DELEGATION_LOOP_URL = "http://www.slf4j.org/codes.html#jclDelegationLoop"; + + // check for delegation loops + static { + try { + Class.forName("org.apache.commons.logging.impl.SLF4JLogFactory"); + String part1 = "Detected both jcl-over-slf4j.jar AND slf4j-jcl.jar on the class path, preempting StackOverflowError. "; + String part2 = "See also " + JCL_DELEGATION_LOOP_URL + + " for more details."; + + Util.reportFailure(part1); + Util.reportFailure(part2); + throw new IllegalStateException(part1 + part2); + } catch (ClassNotFoundException e) { + // this is the good case + } + } + // key: name (String), value: a JCLLoggerAdapter; Map loggerMap; diff --git a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 2b2514a..9fea2be 100644 --- a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -65,7 +65,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { */ //to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; + public static String REQUESTED_API_VERSION = "1.5.11"; // Binding specific code: private static final String loggerFactoryClassStr = JCLLoggerFactory.class diff --git a/slf4j-jdk14/pom.xml b/slf4j-jdk14/pom.xml index 8ca8ef6..1cc86d1 100644 --- a/slf4j-jdk14/pom.xml +++ b/slf4j-jdk14/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index c4d2073..92e9db8 100644 --- a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; // !final + public static String REQUESTED_API_VERSION = "1.5.11"; // !final private static final String loggerFactoryClassStr = org.slf4j.impl.JDK14LoggerFactory.class.getName(); diff --git a/slf4j-log4j12/pom.xml b/slf4j-log4j12/pom.xml index e8a6548..070e32f 100644 --- a/slf4j-log4j12/pom.xml +++ b/slf4j-log4j12/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 6cf6d23..2e86c52 100644 --- a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * against. The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; // !final + public static String REQUESTED_API_VERSION = "1.5.11"; // !final private static final String loggerFactoryClassStr = Log4jLoggerFactory.class .getName(); diff --git a/slf4j-migrator/pom.xml b/slf4j-migrator/pom.xml index 69392d0..768a9b0 100644 --- a/slf4j-migrator/pom.xml +++ b/slf4j-migrator/pom.xml @@ -7,7 +7,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-nop/pom.xml b/slf4j-nop/pom.xml index fed1241..01f7781 100644 --- a/slf4j-nop/pom.xml +++ b/slf4j-nop/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 109e415..4c14792 100644 --- a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; // !final + public static String REQUESTED_API_VERSION = "1.5.11"; // !final private static final String loggerFactoryClassStr = NOPLoggerFactory.class.getName(); diff --git a/slf4j-osgi-integration-test/pom.xml b/slf4j-osgi-integration-test/pom.xml index 8ea99dc..8951a13 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.10 + 1.5.11 4.0.0 diff --git a/slf4j-osgi-test-bundle/pom.xml b/slf4j-osgi-test-bundle/pom.xml index 723382e..97c09a2 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.10 + 1.5.11 4.0.0 diff --git a/slf4j-simple/pom.xml b/slf4j-simple/pom.xml index cb5c89c..f582310 100644 --- a/slf4j-simple/pom.xml +++ b/slf4j-simple/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 5bc87a4..064cb9e 100644 --- a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -58,7 +58,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * against. The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final - public static String REQUESTED_API_VERSION = "1.5.10"; // !final + public static String REQUESTED_API_VERSION = "1.5.11"; // !final private static final String loggerFactoryClassStr = SimpleLoggerFactory.class.getName(); diff --git a/slf4j-site/pom.xml b/slf4j-site/pom.xml index c17dacd..68116ff 100644 --- a/slf4j-site/pom.xml +++ b/slf4j-site/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.10 + 1.5.11 4.0.0 diff --git a/slf4j-site/src/site/pages/codes.html b/slf4j-site/src/site/pages/codes.html index 2c72e02..f5d7ed2 100644 --- a/slf4j-site/src/site/pages/codes.html +++ b/slf4j-site/src/site/pages/codes.html @@ -1,11 +1,13 @@ - -SLF4J Error Codes - + + SLF4J Error Codes + + - + + @@ -13,6 +15,7 @@ +
@@ -151,7 +154,7 @@ slf4j-simple-${version}.jar and slf4j-nop-${version}.jar on the class path and you wish to use the nop (no-operation) binding, then remove - slf4j-simple-${version}.jar from the class parh.

+ slf4j-simple-${version}.jar from the class path.

@@ -168,7 +171,102 @@ an effective remedy.

- + + +

+ 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
  • +
  • + JUnit + 4 Test Logging Tips using SLF4J, by Pete Sellars +
  • commons-logging.jar with jcl-over-slf4j.jar. Subsequently, the selection of the underlying logging framework will be done by SLF4J instead of JCL - but without the class loader headaches. The underlying logging - framework can be any of the frameworks supported by SLF4J. + but without the + class loader headaches plaguing JCL. The underlying logging + framework can be any of the frameworks supported by SLF4J. Often + times, replacing commons-logging.jar with + jcl-over-slf4j.jar will immediately and permanently solve + class loader issues related to commons logging.

    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 {
    slf4j-jdk14-${project.version}.jar
    Binding for java.util.logging, also referred to as JDK 1.4 - logging (examples)

    + logging

    slf4j-jcl-${project.version}.jar
    ----------------------------------------------------------------------- Summary of changes: slf4j-site/src/site/pages/docs.html | 7 ++++++- slf4j-site/src/site/pages/legacy.html | 8 ++++++-- slf4j-site/src/site/pages/manual.html | 3 +-- 3 files changed, 13 insertions(+), 5 deletions(-) hooks/post-receive -- SLF4J: Simple Logging Facade for Java From ceki at qos.ch Sat Feb 27 15:12:12 2010 From: ceki at qos.ch (=?ISO-8859-1?Q?Ceki_G=FClc=FC?=) Date: Sat, 27 Feb 2010 15:12:12 +0100 Subject: [slf4j-dev] Fwd: global exclusions in Maven Message-ID: <4B89283C.9030105@qos.ch> FYI. I just sent this to Matt Raible (the author of appfuse) who has asked for global exclusions in Maven. -------- Original Message -------- Subject: global exclusions in Maven Date: Sat, 27 Feb 2010 15:09:12 +0100 From: Ceki G?lc? To: matt at ... CC: Ceki Gulcu Hello Matt, I just wanted to inform you that even without global exclusions in Maven, it is still possible to exclude commons logging quite conveniently. Given that jcl-over-slf4j is a perfect binary replacement for commons logging, simply declare commons-logging in the provided scope in the a project top-level pom.xml file. This translates into the following pom file snippet: commons-logging commons-logging 1.1.1 provided org.slf4j jcl-over-slf4j 1.5.11 There is an SLF4J FAQ entry discussing this same point [1]. I don't believe global exclusions would buy us anything more than what is already available by declaring CL in the provided scope. Cheers, -- Ceki [1] http://slf4j.org/faq.html#excludingJCL From git-noreply at pixie.qos.ch Sat Feb 27 15:25:21 2010 From: git-noreply at pixie.qos.ch (added by portage for gitosis-gentoo) Date: Sat, 27 Feb 2010 15:25:21 +0100 (CET) Subject: [slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.9.RC1-25-g59753aa Message-ID: <20100227142521.B4BF1314B5A@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 59753aaec81369c7f2b59818587cbedaf005a0c1 (commit) from 4901ff5a22177bf6165beabde79d3fe135e9dd43 (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=59753aaec81369c7f2b59818587cbedaf005a0c1 http://github.com/ceki/slf4j/commit/59753aaec81369c7f2b59818587cbedaf005a0c1 commit 59753aaec81369c7f2b59818587cbedaf005a0c1 Author: Ceki Gulcu Date: Sat Feb 27 15:24:54 2010 +0100 added a FAQ entry about wrapping SLF4J diff --git a/slf4j-site/src/site/pages/faq.html b/slf4j-site/src/site/pages/faq.html index 7da0d9d..eb9661c 100644 --- a/slf4j-site/src/site/pages/faq.html +++ b/slf4j-site/src/site/pages/faq.html @@ -71,6 +71,13 @@
  • + In order to reduce the number of + dependencies of our software we would like to make SLF4J an + optional dependency. Is that a good idea? + +
  • + +
  • What about Maven 2 transitive dependencies? @@ -485,19 +492,87 @@ org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory
    -

    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.


    + + +
    + In + order to reduce the number of dependencies of our software we + would like to make SLF4J an optional dependency. Is that a good + idea? + +
    + +
    +

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

    +
    + + + +
    What about Maven2 transitive dependencies?
    @@ -531,7 +606,7 @@ org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory

    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