Inspectopedia Help

Class with multiple loggers

Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.

For example:

public class Critical { protected static final Logger LOG = Logger.getLogger(Critical.class); protected static final Logger myLogger = Logger.getLogger(getClass()); }

Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.

Inspection options

Option

Type

Default

Logger class names

StringList

[java.util.logging.Logger, org.slf4j.Logger, org.apache.commons.logging.Log, org.apache.log4j.Logger, org.apache.logging.log4j.Logger]

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023