Inspectopedia Help

Log condition does not match logging call

Reports is log enabled for conditions of if statements that do not match the log level of the contained logging call.

For example:

if (LOG.isTraceEnabled()) { // debug level logged, but checked for trace level LOG.debug("some log message"); }

This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks.

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.16690

Last modified: 29 April 2024