diff --git a/binderVersion.pl b/binderVersion.pl index 158ff166..688d4ae4 100644 --- a/binderVersion.pl +++ b/binderVersion.pl @@ -5,6 +5,9 @@ if ($#ARGV < 1) { } $V= $ARGV[0]; +# Trim -SNAPSHOT +$V =~ s/-SNAPSHOT//; + print "VER:${V}\r\n"; shift(@ARGV); diff --git a/goVersion.sh b/goVersion.sh index 9f19e976..77105f8b 100644 --- a/goVersion.sh +++ b/goVersion.sh @@ -4,4 +4,4 @@ echo "Changing pom.xml files" find . -name "pom.xml" |xargs perl version.pl ${VER} echo "Changing Java files" find . -name "StaticLoggerBinder.java" |xargs perl binderVersion.pl ${VER} -find slf4j-api -name "LoggerFactory.java" |xargs perl binderVersion.pl ${VER} + diff --git a/integration/build.xml b/integration/build.xml index 3156ba6b..65bdc452 100644 --- a/integration/build.xml +++ b/integration/build.xml @@ -38,15 +38,15 @@ - + - + diff --git a/integration/pom.xml b/integration/pom.xml index 182ce58c..c3056f3d 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/integration/src/test/java/org/slf4j/Pre154VersionMismatchTest.java b/integration/src/test/java/org/slf4j/Pre155VersionMismatchTest.java similarity index 52% rename from integration/src/test/java/org/slf4j/Pre154VersionMismatchTest.java rename to integration/src/test/java/org/slf4j/Pre155VersionMismatchTest.java index d36a3a58..4c7248ef 100644 --- a/integration/src/test/java/org/slf4j/Pre154VersionMismatchTest.java +++ b/integration/src/test/java/org/slf4j/Pre155VersionMismatchTest.java @@ -5,14 +5,13 @@ import java.util.Random; import junit.framework.TestCase; -public class Pre154VersionMismatchTest extends TestCase { +public class Pre155VersionMismatchTest extends TestCase { - StringPrintStream sps = new StringPrintStream(System.err); PrintStream old = System.err; int diff = 1024 + new Random().nextInt(10000); - - public Pre154VersionMismatchTest(String name) { + + public Pre155VersionMismatchTest(String name) { super(name); } @@ -26,18 +25,11 @@ public class Pre154VersionMismatchTest extends TestCase { System.setErr(old); } - - public void test() throws Exception { + public void test() throws Exception { Logger logger = LoggerFactory.getLogger(this.getClass()); - String msg = "hello world "+diff; + String msg = "hello world " + diff; logger.info(msg); String s0 = (String) sps.stringList.get(0); - assertTrue(s0.startsWith("SLF4J: The version of your slf4j-binding is probably older than 1.5.4")); - - String s1 = (String) sps.stringList.get(1); - assertTrue(s1.contains(LoggerFactory.VERSION_MISMATCH)); - - String s2 = (String) sps.stringList.get(2); - assertTrue(s2.contains(msg)); + assertTrue(s0.contains(msg)); } } diff --git a/jcl-over-slf4j/pom.xml b/jcl-over-slf4j/pom.xml index 441dfe47..e3f133ca 100644 --- a/jcl-over-slf4j/pom.xml +++ b/jcl-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/jcl104-over-slf4j/pom.xml b/jcl104-over-slf4j/pom.xml index a3f9e78d..157e8fde 100644 --- a/jcl104-over-slf4j/pom.xml +++ b/jcl104-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/jul-to-slf4j/pom.xml b/jul-to-slf4j/pom.xml index a94c6101..91cd43ad 100644 --- a/jul-to-slf4j/pom.xml +++ b/jul-to-slf4j/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/log4j-over-slf4j/pom.xml b/log4j-over-slf4j/pom.xml index 58de38d3..fb19cb26 100644 --- a/log4j-over-slf4j/pom.xml +++ b/log4j-over-slf4j/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/osgi-over-slf4j/pom.xml b/osgi-over-slf4j/pom.xml index f467858a..a48e1be0 100644 --- a/osgi-over-slf4j/pom.xml +++ b/osgi-over-slf4j/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 8085a491..d3ad9001 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT pom SLF4J diff --git a/slf4j-api/pom.xml b/slf4j-api/pom.xml index dcefd451..ba9ce6a3 100644 --- a/slf4j-api/pom.xml +++ b/slf4j-api/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 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 a872973b..ca2097b9 100644 --- a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java +++ b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java @@ -25,6 +25,7 @@ package org.slf4j; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.slf4j.helpers.SubstituteLoggerFactory; @@ -56,7 +57,13 @@ public final class LoggerFactory { static final String VERSION_MISMATCH = "http://www.slf4j.org/codes.html#version_mismatch"; static final String SUBSTITUTE_LOGGER_URL = "http://www.slf4j.org/codes.html#substituteLogger"; - static private final String EXPECTED_VERSION = "1.5.4"; + /** + * It is out responsibility to track version changes and manage the + * compatibility list. + * + *

+ */ + static private final String[] API_COMPATIBILITY_LIST = new String[] { "1.5.5" }; // private constructor prevents instantiation private LoggerFactory() { @@ -95,7 +102,7 @@ public final class LoggerFactory { } private final static void emitSubstitureLoggerWarning(List loggerNameList) { - if(loggerNameList.size() == 0) { + if (loggerNameList.size() == 0) { return; } Util @@ -111,22 +118,29 @@ public final class LoggerFactory { private final static void versionSanityCheck() { try { - String actualVer = StaticLoggerBinder.VERSION; - if (!EXPECTED_VERSION.equals(actualVer)) { - Util.reportFailure("The version " + actualVer - + " of your slf4j-binding differs from " + EXPECTED_VERSION - + ", the expected version."); + String requested = StaticLoggerBinder.REQUESTED_API_VERSION; + + boolean match = false; + for (int i = 0; i < API_COMPATIBILITY_LIST.length; i++) { + if (API_COMPATIBILITY_LIST[i].equals(requested)) { + match = true; + } + } + if (!match) { + Util.reportFailure("The requested version " + requested + + " of your slf4j-binding does not match any of " + + Arrays.toString(API_COMPATIBILITY_LIST)); Util.reportFailure("See " + VERSION_MISMATCH + " for further details."); } } catch (java.lang.NoSuchFieldError nsfe) { - Util - .reportFailure("The version of your slf4j-binding is probably older than 1.5.4, and differs from " - + EXPECTED_VERSION + ", the expected version."); - Util.reportFailure("See " + VERSION_MISMATCH + " for further details."); + // given our large user base anbd SLF4J's commitment to backward + // compatibility, we cannot cry + // here. Only for implementations which willingly declare a + // REQUESTED_API_VERSION field do we emit compatibility warnings. } catch (Throwable e) { - Util - .reportFailure("An unexpected problem occured while checking the version of your slf4j-binding"); - e.printStackTrace(); + // we should never reach here + Util.reportFailure( + "Unexpected problem occured during version sanity check", e); } } 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 0c2b780d..ab08a4d6 100644 --- a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -44,11 +44,11 @@ public class StaticLoggerBinder { public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); /** - * Version tag used to check compatibility. The value of this field is - * modified with each release. + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is usually modified with each release. */ - // to avoid constant folding by the compiler, VERSION field should *not* be final - public static String VERSION = "1.5.4"; // !final + // to avoid constant folding by the compiler, this field must *not* be final + public static String REQUESTED_API_VERSION = "1.5.5"; // !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 7e8721de..afeb0ca2 100644 --- a/slf4j-ext/pom.xml +++ b/slf4j-ext/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/slf4j-jcl/pom.xml b/slf4j-jcl/pom.xml index 31ca75f1..16914d0d 100644 --- a/slf4j-jcl/pom.xml +++ b/slf4j-jcl/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 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 3ff9cd40..12989b9d 100644 --- a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -54,8 +54,9 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * Version tag used to check compatibility. The value of this field is * modified with each release. */ - //to avoid constant folding by the compiler, VERSION field should *not* be final - public static String VERSION = "1.5.4"; + + //to avoid constant folding by the compiler, this field must *not* be final + public static String REQUESTED_API_VERSION = "1.5.5"; // Binding specific code: private static final String loggerFactoryClassStr = JCLLoggerFactory.class diff --git a/slf4j-jdk14/pom.xml b/slf4j-jdk14/pom.xml index 83f284f0..e420cf90 100644 --- a/slf4j-jdk14/pom.xml +++ b/slf4j-jdk14/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 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 087016c9..fbd71e18 100644 --- a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -49,13 +49,14 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { * The unique instance of this class. */ public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); - + /** - * Version tag used to check compatibility. The value of this field is - * modified with each release. - */ - //to avoid constant folding by the compiler, VERSION field should *not* be final - public static String VERSION = "1.5.4"; + * Declare the version of the SLF4J API this implementation is compiled 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.5"; // !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 5a42c723..a0490367 100644 --- a/slf4j-log4j12/pom.xml +++ b/slf4j-log4j12/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 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 0cb3c1f8..01714c83 100644 --- a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -52,10 +52,11 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); /** - * Version tag used to check compatibility. The value of this field is - * modified in each release. + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is usually modified with each release. */ - public static final String VERSION = "1.5.4"; + // to avoid constant folding by the compiler, this field must *not* be final + public static String REQUESTED_API_VERSION = "1.5.5"; // !final private static final String loggerFactoryClassStr = Log4jLoggerFactory.class.getName(); diff --git a/slf4j-migrator/pom.xml b/slf4j-migrator/pom.xml index 357bd1aa..50347518 100644 --- a/slf4j-migrator/pom.xml +++ b/slf4j-migrator/pom.xml @@ -7,7 +7,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/slf4j-nop/pom.xml b/slf4j-nop/pom.xml index 934a6011..e3f33662 100644 --- a/slf4j-nop/pom.xml +++ b/slf4j-nop/pom.xml @@ -6,7 +6,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 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 b0a7233c..ca76e99d 100644 --- a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -51,11 +51,11 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); /** - * Version tag used to check compatibility. The value of this field is - * modified with each release. - */ - //to avoid constant folding by the compiler, VERSION field should *not* be final - public static String VERSION = "1.5.4"; + * Declare the version of the SLF4J API this implementation is compiled 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.5"; // !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 6febf398..d3b9fa3c 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.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/slf4j-osgi-test-bundle/pom.xml b/slf4j-osgi-test-bundle/pom.xml index 79b96856..bf9303c1 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.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/slf4j-simple/pom.xml b/slf4j-simple/pom.xml index d64d8eb9..edd2689b 100644 --- a/slf4j-simple/pom.xml +++ b/slf4j-simple/pom.xml @@ -3,7 +3,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 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 f2b945a6..bbe95371 100644 --- a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -43,11 +43,11 @@ public class StaticLoggerBinder implements LoggerFactoryBinder { public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); /** - * Version tag used to check compatibility. The value of this field is - * modified with each release. - */ - //to avoid constant folding by the compiler, VERSION field should *not* be final - public static String VERSION = "1.5.4"; + * Declare the version of the SLF4J API this implementation is compiled 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.5"; // !final private static final String loggerFactoryClassStr = SimpleLoggerFactory.class.getName(); diff --git a/slf4j-site/pom.xml b/slf4j-site/pom.xml index 52a6bb98..217ad991 100644 --- a/slf4j-site/pom.xml +++ b/slf4j-site/pom.xml @@ -5,7 +5,7 @@ org.slf4j slf4j-parent - 1.5.4 + 1.5.5-SNAPSHOT 4.0.0 diff --git a/slf4j-site/src/site/pages/codes.html b/slf4j-site/src/site/pages/codes.html index 1b3d409c..57ed3c46 100644 --- a/slf4j-site/src/site/pages/codes.html +++ b/slf4j-site/src/site/pages/codes.html @@ -164,9 +164,9 @@ prefix=''; version does not match that of the binding

Mixing mixing different versions of slf4j artifacts can cause - problems. For example, if you are using slf4j-api-1.5.4.jar, then - you should also use slf4j-simple-1.5.4.jar, using - slf4j-simple-1.4.2.jar will not work. + problems. For example, if you are using slf4j-api-1.5.5.jar, then + you should also use slf4j-simple-1.5.5.jar, using + slf4j-simple-1.4.2.jar will not work.

In general, you should take sure that the slf4j-api version @@ -178,43 +178,42 @@ prefix='';

-

Substitute - loggers were created during the default configuration phase of the - underlying logging system

+

Substitute + loggers were created during the default configuration phase of the + underlying logging system

-

Highly configurable logging systems such as logback and log4j may - create components which invoke loggers during their own - initialization. See issue lbcore-47 for a - typical occurrence. However, since the binding process with SLF4J has - not yet completed (because the underlying logging system was not yet - completely loaded into memory), it is not possible to honor such - logger creation requests, resulting in a - NullPointerException.

+

Highly configurable logging systems such as logback and log4j + may create components which invoke loggers during their own + initialization. See issue lbcore-47 for a + typical occurrence. However, since the binding process with SLF4J + has not yet completed (because the underlying logging system was + not yet completely loaded into memory), it is not possible to + honor such logger creation requests, resulting in a + NullPointerException.

-

To avoid this chicken-and-egg problem, SLF4J substitutes a - no-operation logger factory during this initialization - phase. However, the loggers returned during this phase by the - substitute logger factory are not operational. They are nop - implementations. -

+

To avoid this chicken-and-egg problem, SLF4J substitutes a + no-operation logger factory during this initialization + phase. However, the substitute loggers returned during this phase + are not operational. They are nop implementations. +

-

If any substitute logger had to be created, SLF4J will emit a - warning listing such nop loggers. This warning is intended to let - you know that you should not expect any logging output from these - loggers. -

+

If any substitute logger had to be created, SLF4J will emit a + warning listing such nop loggers. This warning is intended to let + you know that you should not expect any logging output from these + loggers. +

-

The only way to obtain output from the listed loggers, is to - isolate the components invoking these loggers and to exclude them - from the default configuration. Both logback and log4j allow - multi-step configuration. It follows that the problematic components - should be configured in a second step separate from default - configuration. -

+

The only way to obtain output from the listed loggers, is to + isolate the components invoking these loggers and to exclude them + from the default configuration. Both logback and log4j allow + multi-step configuration. It follows that the problematic + components should be configured in a second step separate from + default configuration. +

-

If you are not interested in the output from any of the - substitute loggers, then no action is required on your part.

+

If you are not interested in the output from any of the + substitute loggers, then no action is required on your part.

diff --git a/slf4j-site/src/site/pages/faq.html b/slf4j-site/src/site/pages/faq.html index c76e4e9e..5c1f30da 100644 --- a/slf4j-site/src/site/pages/faq.html +++ b/slf4j-site/src/site/pages/faq.html @@ -133,6 +133,10 @@ prefix='';
  • How can my logging system add support for the Marker interface?
  • +
  • How does SLF4J's version check + mechanism work?
  • + + @@ -910,7 +914,7 @@ class MyClass { org.slf4j.Logger interface. Refer to slf4j-jcl, slf4j-jdk14, and slf4j-log4j12 modules for examples of adapters. -

    +

    Once you have written an appropriate adapter, say MyLoggerAdapter, you need to provide a factory @@ -918,7 +922,7 @@ class MyClass { interface. This factory should return instances MyLoggerAdapter. Let MyLoggerFactory be the name of your factory class. -

    +

    Once you have the adapter, namely MyLoggerAdapter, and a factory, namely @@ -942,7 +946,7 @@ class MyClass { org.slf4j.Logger interface

  • create a factory for the adapter created in the previous step,
  • -
  • >modify StaticLoggerBinder class to use the +
  • modify StaticLoggerBinder class to use the factory you created in the previous step
  • @@ -961,37 +965,77 @@ class MyClass { allowed to ignore marker data passed by the user.

    -

    However, even though marker data may be ignored, the user - must still be allowed to specify marker data. Otherwise, users - would not be able to switch between logging systems that - support markers and those that do not. In order to provide - minimal support for markers, SLF4J conforming systems need to - to include certain Marker related classes, namely, - org.slf4j.Marker, - org.slf4j.IMarkerFactory, - org.slf4j.MarkerFactory, - org.slf4j.impl.BasicMarker, - org.slf4j.impl.BasicMarkerFactory, - org.slf4j.impl.MarkerIgnoringBase, - org.slf4j.impl.StaticMarkerBinder and - org.slf4j.spi.MarkerFactoryBinder. Al of these - classes are available in the SLF4J subversion repository. -

    +

    However, even though marker data may be ignored, the user + must still be allowed to specify marker data. Otherwise, users + would not be able to switch between logging systems that + support markers and those that do not. +

    -

    The MarkerIgnoringBase class can serve as a - base for adapters or native implementations of logging systems - lacking marker support. In MarkerIgnoringBase, - methods taking marker data simply invoke the corresponding - method without the Marker argument, discarding any Marker data - passed as argument. Your SLF4J adapters can extend - MarkerIgnoringBase to quickly implement the - methods in org.slf4j.Logger which take a - Marker as the first argument. -

    +

    The MarkerIgnoringBase class can serve as a + base for adapters or native implementations of logging + systems lacking marker support. In + MarkerIgnoringBase, methods taking marker data + simply invoke the corresponding method without the Marker + argument, discarding any Marker data passed as + argument. Your SLF4J adapters can extend + MarkerIgnoringBase to quickly implement the + methods in org.slf4j.Logger which take a + Marker as the first argument. +


    + +
    How does + SLF4J's version check mechanism work?
    + +
    +

    Given its huge installed user base, the version check + performed by SLF4J API during its initialization is an + elective process. Conforming SLF4J implementations may choose + not to participate, in which case, no version check + will be performed. +

    + +

    However, if you decide to participate, your SLF4J binding + needs to declare a variable called REQUESTED_API_VERSION + within your copy of the StaticLoggerBinder + class. The value of this variable should be equal to the + version of the slf4j-api.jar you are compiling against. If you + ugrade to a newer version of slf4j-api, you also need to + update the value of REQUESTED_API_VERSION. (That is all you + have to do.) +

    + +

    For earch version, SLF4J API maintains a list of compatible + versions. SLF4J will emit a version mismatch warning only if + the requested version is not found in the compatibility + list. So even if your SLF4J binding has a different release + schedule than SLF4J, you can still participate in the version + check without incurring a mismatch warning. For example, + logback has a different release schedule but still + participates in version checks.

    + +

    As of SLF4J 1.5.5, all bindings shipped within SLF4J + distribution, e.g. slf4j-logj12, slf4j-simple and slf4j-jdk14, + declare the REQUESTED_API_VERSION field with a value equal to + their SLF4J version. It follows that, for example if + slf4j-simple-1.5.6.jar is mixed with simple-api-1.5.5.jar, + then a version mismatch warning will be issued. Note that + SLF4J prior to 1.5.5 did not have a version check + mechanism. (Actually, version 1.5.4 offered a check policy + which was much too restritive and inconsistent with the size + of our user base. Consequently, SLF4J version 1.5.5 was + released just a day after 1.5.4.) +

    + +

    +

    + +
    + +