diff --git a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java index 30b7d21a7..06828e5e3 100755 --- a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java +++ b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java @@ -304,7 +304,9 @@ private static void replaySingleEvent(SubstituteLoggingEvent event) { if (substLogger.isDelegateNOP()) { // nothing to do } else if (substLogger.isDelegateEventAware()) { - substLogger.log(event); + if(substLogger.isEnabledForLevel(event.getLevel())) { + substLogger.log(event); + } } else { Util.report(loggerName); } diff --git a/slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java b/slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java index 7ed2d509a..b833e40c5 100644 --- a/slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java +++ b/slf4j-api/src/main/java/org/slf4j/spi/LoggingEventAware.java @@ -4,7 +4,17 @@ /** * A logger capable of logging from org.slf4j.event.LoggingEvent implements this interface. - * + * + *

Please note that when the {@link #log(LoggingEvent)} method assumes that + * the event was filtered beforehand and no further filtering needs to occur by the method itself. + *

+ * + *

Implementations of this interface may apply further filtering but they are not + * required to do so. In other words, {@link #log(LoggingEvent)} method is free to assume that + * the event was filtered beforehand and no further filtering needs to occur in the method itself.

+ * + * See also https://jira.qos.ch/browse/SLF4J-575 + * * @author Ceki Gulcu * @since 2.0.0 */