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

 

⇒ 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, 219👍, 0💬