SLF4J

Simple Logging Facade for Java (SLF4J) provides a Java logging API by means of a simple facade pattern. The underlying logging backend is determined at runtime by adding the desired binding to the classpath and may be the standard Sun Java logging package java.util.logging, log4j, logback or tinylog.
The separation of the client API from the logging backend reduces the coupling between an application and any particular logging framework. This can make it easier to integrate with existing or third-party code or to deliver code into other projects that have already made a choice of logging backend.
SLF4J was created by Ceki Gülcü as a more reliable alternative to Jakarta Commons Logging framework. Research in 2013 on 10,000 GitHub projects found that the most popular Java library is SLF4J, along with JUnit, with 30.7% of projects using it.
Similarities and differences with log4j 1.x.
 private static final Logger LOG = LoggerFactory.getLogger(Wombat.class);
 LOG.debug("There are now " + count + " user accounts: " + userAccountList); // slower
 LOG.debug("There are now {} user accounts: {}", count, userAccountList); // faster
Similarities and differences with log4j 2.x.
Apache log4j 2.x supports all slf4j features.
Version history.
Version 2.
Version 2 is currently in development, with an alpha pre-release available. Requires Java 8 or later.
Significant feature additions:
Version 1.
Version details can be found in the manual.
Significant versions include: