How To Install slf4j on CentOS 8
Introduction
In this tutorial we learn how to install slf4j
on CentOS 8.
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 CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install slf4j.
Install slf4j on CentOS 8 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 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 CentOS 8 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
The output should look something like this:
CentOS Linux 8 - AppStream 43 kB/s | 4.3 kB 00:00
CentOS Linux 8 - BaseOS 65 kB/s | 3.9 kB 00:00
CentOS Linux 8 - ContinuousRelease 43 kB/s | 3.0 kB 00:00
CentOS Linux 8 - Extras 23 kB/s | 1.5 kB 00:00
CentOS Linux 8 - FastTrack 40 kB/s | 3.0 kB 00:00
CentOS Linux 8 - HighAvailability 36 kB/s | 3.9 kB 00:00
CentOS Linux 8 - Plus 24 kB/s | 1.5 kB 00:00
CentOS Linux 8 - PowerTools 50 kB/s | 4.3 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - x86_64 13 kB/s | 9.2 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 24 kB/s | 8.5 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 CentOS 8
To uninstall only the slf4j
package we can use the following command:
sudo dnf remove slf4j
slf4j Package Contents on CentOS 8
/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 CentOS 8 using yum and dnf.