How To Install logback on CentOS 7

In this tutorial we learn how to install logback on CentOS 7. logback is A Java logging library

Introduction

In this tutorial we learn how to install logback on CentOS 7.

What is logback

Logback is intended as a successor to the popular log4j project. At present time, logback is divided into three modules, logback-core, logback-classic and logback-access. The logback-core module lays the groundwork for the other two modules. The logback-classic module can be assimilated to a significantly improved version of log4j. Moreover, logback-classic natively implements the SLF4J API so that you can readily switch back and forth between logback and other logging frameworks such as log4j or java.util.logging (JUL). The logback-access module integrates with Servlet containers, such as Tomcat and Jetty, to provide HTTP-access log functionality. Note that you could easily build your own module on top of logback-core.

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

Install logback on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install logback

Install logback on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install logback

How To Uninstall logback on CentOS 7

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

sudo dnf remove logback

References

Summary

In this tutorial we learn how to install logback on CentOS 7 using yum and dnf.