Inspectopedia Help

Class without logger

Reports classes which do not have a declared logger.

Ensuring that every class has a dedicated logger is an important step in providing a unified logging implementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.

For example:

public class NoLoggerDeclared { int calculateNthDigitOfPi(int n) { // todo return 1; } }

Use the table in the Options section to specify logger class names. Classes which do not declare a field with the type of one of the specified classes will be reported by this inspection.

Inspection options

Option

Type

Default

TabSet

None

Loggers

Tab

None

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]

Ignored Classes

Tab

None

Ignore subclasses of

StringList

[java.lang.Throwable]

Ignore when superclass has an accessible logger

Checkbox

false

Annotations

Tab

None

Ignore classes annotated by

StringList

[]

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023