SLF4J Changelog

What's new in SLF4J 1.7.12

Mar 27, 2015
  • All java files have been reformatted to with the code formatter style defined in codeStyle.xml. This style uses 4 spaces for indentation and a maximum line width of 160.
  • As SLF4J requires JDK 1.5 or later, the Bundle-RequiredExecutionEnvironment declaration in the various MANIFEST files have been updated to J2SE-1.5.
  • Added missing Bundle-ManifestVersion attribute in the MANIFEST files in log4j-over-slf4j. The issue was raised in SLF4J-231 by Nikolas Falco who also provided the the appropriate pull request.
  • Added getAppender(String) method in Category class in the log4j-over-slf4j module. This addition was requested by Ramon Gordillo in SLF4J-319.
  • Added setThreshold method in AppenderSkeleton class in the log4j-over-slf4j module. This addition was requested by Dimitrios Liapis who also provided the appropriate pull request.
  • Added getParent method in Category class in the log4j-over-slf4j module. This addition was requested by Himanshu Bhardwaj in SLF4J-318.

New in SLF4J 1.7.10 (Jan 7, 2015)

  • The MDC.putCloseable method now explicitly returns MDC.MDCloseable instead of the more generic java.io.Closeable. This in turn allows one to write try-with-resources statement without a catch clause. Many thanks to William Delanoue for proposing this change.
  • The various constructors in FileAppender in the log4j-over-slf4j module are now public.

New in SLF4J 1.7.9 (Dec 30, 2014)

  • Spot incorrectly named loggers by setting the slf4j.detectLoggerNameMismatch system property to true. This significant feature was contributed by Alexander Dorokhine.
  • Added MDC.putCloseable method so that it can be used as a closeable resource under Java 7.
  • Added getContext method returning a hashtable in org.apache.log4j.MDC in the log4j-over-slf4j module.
  • The introduction of the @Nonnull JSR 305 annotation in SLF4J version 1.7.8 causes the Scala compiler to fail. This is issue has been documented in SI-5420. Given that many Scala users will be affected by this issue for the foreseeable future, we have decided to renounce the user of JSR 305 annotations in SLF4J for the time being.
  • Numerous small code improvements too minor to be listed here.

New in SLF4J 1.7.7 (Apr 7, 2014)

  • SFL4J API now uses generics. This enhancement was contributed by Otavio Garcia. Due to erasure of generics in Java, the changes are backward-compatible.
  • The slf4j-migrator can now convert statements using the long deprecated Category class.
  • Added the SimpleLayout and FileAppender classes to the log4j-over-slf4j module.

New in SLF4J 1.7.6 (Feb 6, 2014)

  • Added slf4j-android module to the slf4j distribution. This module is contributed by Andrey Korzhevskiy.
  • Loggers created during the initialization phase are no longer NOPLoggers which drop all logging calls. Instead, SLF4J now creates substitute loggers which delegate to the appropriate logger implementation after the initilization phase completes. Only calls made to these loggers during the initialization phase are dropped. This enhacement was proposed in bug 311 by Chetan Mehrotra.
  • Improvements to the exit() and throwing() methods in XLogger. This enhacement was requested in bug 197.
  • Concunrrency improvement in MessageFormatter. This improvement was contributed by Vivek Pathak in a pull request.
  • Concunrrency improvement in BasicMarkerFactory. This improvement was contributed by Mikhail Mazursky in a pull request.
  • JCLLoggerAdapter was incorrectly invoking isDebugEnabled calls in its trace() methods. This issue was reported in bug 281.
  • In the log4j-over-slf4j module, the setLevel method in the Category class. This fixes bug 279. Alfredo Ramos provied the relevant patch.
  • In the log4j-over-slf4j module, added empty implementations for OptionHander, WriterAppender, ConsoleAppender and AppenderSkeleton classes.

New in SLF4J 1.7.5 (Mar 26, 2013)

  • Performance improvements:
  • The logger factories in most SLF4J modules namely in jcl-over-slf4j, log4j-over-slf4j, slf4j-jcl, slf4j-jdk14, slf4j-log4j12, and slf4j-simple now use a ConcurrentHashMap instead of a regular HashMap to cache logger instances. This change significantly improves logger retrieval times at the cost of some memory overhead. This improvement was requested in bug #298 by Taras Tielkes who also provided the relevant patch.

New in SLF4J 1.7.4 (Mar 19, 2013)

  • Added a package private reset() method to SimpleLoggerFactory for testing purposes.

New in SLF4J 1.7.3 (Mar 15, 2013)

  • The jul-to-slf4j bridge now correctly handles cases where the message string contains {}-placeholders but has no or zero parameters. This fixes bug #212. The relevant patch was provided by Matthew Preston in a git pull request.
  • Added missing methods and classes in log4j-over-slf4j module for Velocity compatibility. This isssue was reported in bug 280 by Thomas Mortagne.

New in SLF4J 1.7.2 (Oct 12, 2012)

  • Added osgi-over-slf4j module which serves as an OSGi LogService implementation delegating to slf4j. This module is maintained by Matt Bishop and Libor Jelinek.
  • Christian Trutz added missing PatternLayout class as well as several methods in the Logger and Category classes. See commit 442e90ba5785cba9 dated September 27th 2012 for details.
  • Added org.slf4j.simpleLoggerwarnLevelString in slf4j-simple module.
  • Fixed bug 272. All Logger implementations shipping with SLF4J use Object... instead of Object[] to avoid compiler warnings.

New in SLF4J 1.7.1 (Sep 21, 2012)

  • SimpleLogger now supports writing to a file. The property names for configuring SimpleLogger have been modified to be consistently in camel case. More configuration options have been added. In the absence of configuration directives, SimpleLogger will behave exactly the same as in the past. If you are one of the few users configuring SimpleLogger with configuration properties, you will need to adapt to the new and more consistent property names.

New in SLF4J 1.7.0 (Sep 7, 2012)

  • Printing methods in the Logger interface now offers variants accepting varargs instead of Object[]. Given that under the hood, the Java compiler transforms varargs into an array, this change is totally 100% no-ifs-or-buts backward compatible with all existing client code.
  • The logger field (of type java.util.logging.Logger) in JDK14LoggerAdapter is now marked as transient. This fixes bug #261, a serialization problem reported by Thorbjørn Ravn Andersen.

New in SLF4J 1.6.6 (Jul 30, 2012)

  • In case multiple bindings are found on the class path, SLF4J will now output the name of the framework/implementation class it binds with.
  • SimpleLogger now supports configuration properties.
  • LoggerWrapper in the slf4j-ext module now correctly deals with markers. This fixes bug #265 reported by Dario Campagna.
  • The log4j-over-slf4j module now supports legacy projects providing their own log4j LoggerFactory. This fixes bug #234 reported by Laurent Pellegrino with Piotr Jagielski providing the appropriate patch.