Logger initialized with foreign class
Reports Logger
instances initialized with a class literal other than the class the Logger
resides in.
This can happen when copy-pasting from another class. It may result in logging events under an unexpected category and incorrect filtering.
Use the inspection options to specify the logger factory classes and methods recognized by this inspection.
Example:
After the quick-fix is applied:
Inspection options
Option | Type | Default |
---|---|---|
Table | None | |
Logger Factory Class Name | TableColumn | [java.util.logging.Logger, org.slf4j.LoggerFactory, org.apache.commons.logging.LogFactory, org.apache.log4j.Logger, org.apache.logging.log4j.LogManager] |
Logger Factory Method Name | TableColumn | [getLogger, getLogger, getLog, getLogger, getLogger] |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Kotlin, @snapshot@ |