Compatibility report

Given the very large user base of SLF4J, we take backward compatibility very seriously. As such, changes that may cause incompatibility problems are listed in this page. Moreover, since slf4j-api.jar is the main entry point into SLF4J, that is the module that will be covered in most detail.

The list is computed using clirr. If you have reasons to suspect incompatible changes not mentioned here, please kindly contact the slf4j developers list.

Version 1.5.2 compared to 1.5.1

No breaking changes to report.

Version 1.5.1 compared to 1.5.0

slf4j-api module, list of breaking changes:

Severity Description Class Method / Field
Error Method 'getCopyOfContextMap()' has been added to an interface org.slf4j.spi.MDCAdapter public java.util.Map getCopyOfContextMap()
Error Method 'setContextMap(Map)' has been added to an interface org.slf4j.spi.MDCAdapter public void setContextMap(java.util.Map)
Error Method 'getDetachedMarker(String)' has been added to an interface org.slf4j.IMarkerFactory public org.slf4j.Marker getDetachedMarker(java.lang.String)
Info Method 'equals(Object)' has been added to an interface org.slf4j.Marker public boolean equals(java.lang.Object)
info Method 'hashCode()' has been added to an interface org.slf4j.Marker public int hashCode()

The addition of the getCopyOfContextMap() method in the MDCAdapter class should only impact users who have their own implementation of the said interface. Except for bindings that ship with SLF4J and for logback-classic, which will be naturally upgraded, there are no known other implementations of MDCAdapter. In a rare but still possible scenario, if the user mixes different versions for slf4j-api.jar, say version 1.5.1. and an SLF4J binding, say slf4j-log4j12.jar version 1.5.0, then a java.lang.AbstractMethodError will be thrown, but only if the client code calls the newly added method. In short, although generally speaking the addition of a method to an interface is a breaking change, we are confident that no users will be impacted in this particular case.

Similar reasoning applies to the setContextMap(Map) method.

The addition of getDetachedMarker(String) method in the org.slf4j.IMarkerFactory should not impact users as the only (known) implementation of this interface ships with SLF4J itself.

The equals() and hashCode() methods were added to the org.slf4j.Marker interface for documentation purposes. Given that all objects implicitly implement these methods, their addition should theoretically not break existing code.

Other modules

No breaking changes to report.

Version 1.5.0 compared to 1.4.3

No breaking changes to report.

Version 1.4.3 compared to 1.4.2

No breaking changes to report.

Version 1.4.2 compared to 1.4.1

No breaking changes to report.

Version 1.4.1 compared to 1.4.0

No breaking changes to report.