How To Install slf4j on Fedora 34

slf4j is Simple Logging Facade for Java

Introduction

In this tutorial we learn how to install slf4j on Fedora 34.

What is slf4j

The Simple Logging Facade for Java or (SLF4J) is intended to serve as a simple facade for various logging APIs allowing to the end-user to plug in the desired implementation at deployment time. SLF4J also allows for a gradual migration path away from Jakarta Commons Logging (JCL). Logging API implementations can either choose to implement the SLF4J interfaces directly, e.g. NLOG4J or SimpleLogger. Alternatively, it is possible (and rather easy) to write SLF4J adapters for the given API implementation, e.g. Log4jLoggerAdapter or JDK14LoggerAdapter..

We can use yum or dnf to install slf4j on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install slf4j.

Install slf4j on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install slf4j using dnf by running the following command:

sudo dnf -y install slf4j

Install slf4j on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install slf4j using yum by running the following command:

sudo yum -y install slf4j

How To Uninstall slf4j on Fedora 34

To uninstall only the slf4j package we can use the following command:

sudo dnf remove slf4j

slf4j Package Contents on Fedora 34

/usr/share/java/slf4j
/usr/share/java/slf4j/api.jar
/usr/share/java/slf4j/nop.jar
/usr/share/java/slf4j/simple.jar
/usr/share/java/slf4j/slf4j-api.jar
/usr/share/java/slf4j/slf4j-nop.jar
/usr/share/java/slf4j/slf4j-simple.jar
/usr/share/licenses/slf4j
/usr/share/licenses/slf4j/APACHE-LICENSE
/usr/share/licenses/slf4j/LICENSE.txt
/usr/share/maven-metadata/slf4j.xml
/usr/share/maven-poms/slf4j
/usr/share/maven-poms/slf4j/api.pom
/usr/share/maven-poms/slf4j/nop.pom
/usr/share/maven-poms/slf4j/simple.pom
/usr/share/maven-poms/slf4j/slf4j-api.pom
/usr/share/maven-poms/slf4j/slf4j-nop.pom
/usr/share/maven-poms/slf4j/slf4j-simple.pom

References

Summary

In this tutorial we learn how to install slf4j on Fedora 34 using yum and dnf.