Introduction

Logging is an important part of every application life cycle. Having a good logging system becomes a key feature that helps developers, sysadmins, and support teams to understand and solve appearing problems.

Every log message has an associated log level. The log level helps you understand the severity and urgency of the message. Usually, each log level has an assigned integer representing the severity of the message.

Though Java provides an extendable logging system, third-party logging libraries can significantly simplify the logging process and usage of advanced logging practices.

In this tutorial, we are going to use a Command Line Application for our examples, and cover 3 methods of logging in Java:

Prerequisites

There are very few prerequisites:

How to create a project

To get started, you need to create a new project. To simplify the work, we are going to use a default IntelliJ template for the Console Applications, the Command Line App template.

You can create a Command Line Application Let's break it down into simple steps, the first thing you need to do is to open the New Project windows. There are several ways how to do it in the IntelliJ IDEA.

The first one is to select Create a new project in the welcome window.

The second one, If the IntelliJ is already open, you can follow the path on the top menu bar File > New > Project.

In the New Project window click on Java, and select the Command Line App template.

How to install dependencies