Inspectopedia 2025.2 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()); }

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

ClassWithMultipleLoggers
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Java | Logging

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

Here you can find the description of settings available for the Class with multiple loggers inspection, and the reference of their default values.

Logger class names

Default value:

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

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection ClassWithMultipleLoggers

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2025.2, Qodana for JVM 2025.2,

Last modified: 18 September 2025