What Is SLF4J API

Q

What Is SLF4J (Simple Logging Facade for Java) API?

✍: Guest

A

The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging libraries (e.g. java.util.logging, logback, log4j) allowing the end user to plug in the desired logging library at deployment time.

SLF4J-enabling your logging library is so simple. All you have to do is to add a single mandatory SLF4J API, namely slf4j-api.jar.

If no logging library is found on the class path, then SLF4J will default to a no-operation implementation.

Since SLF4J only provides an abstract logging API, it must be used together with a specific logging library like Log4J Logging framework as shown below.

SLF4J API and Logging Libraries
SLF4J API and Logging Libraries

Releases of SLF4J library:

SLF4J   2.0.4    2022-11-17
SLF4J   2.0.0    2022-08-20
SLF4J   1.7.36   2022-02-08 
SLF4J   1.7.0    2012-09-06
SLF4J   1.6.0    2010-05-08
SLF4J   1.5.0    2008-02-26
SLF4J   1.4.0    2007-05-22
SLF4J   1.1.0    2006-12-20

 

SLF4J API Binding to Logging Libraries

Downloading and Reviewing SLF4J Packages

Downloading and Reviewing SLF4J Packages

⇑⇑ SLF4J - Simple Logging Facade for Java

2021-07-04, 700🔥, 0💬