-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
After updating to logback-classic 1.5.5, conditional logger
elements from included files break.
The conditional logger
is ignored and the following line is logged:
WARN in ch.qos.logback.core.model.processor.ImplicitModelHandler - Ignoring unknown property [logger] in [ch.qos.logback.classic.LoggerContext]
Reproduction
logback.xml:
<configuration> <include resource="logback-include.xml"/> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="STDOUT"/> </root> </configuration>
logback-include.xml:
<included> <appender name="file" class="ch.qos.logback.core.FileAppender"> <file>filelogging.log</file> <append>true</append> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <if condition='true'> <then> <logger name="custom" additivity="false" level="info"> <appender-ref ref="file"/> </logger> </then> </if> </included>
Expected behaviour:
LoggerFactory.getLogger("root").info("test1"); //logged to console LoggerFactory.getLogger("custom").info("test2"); //logged to file
Actual behaviour:
LoggerFactory.getLogger("root").info("test1"); //logged to console LoggerFactory.getLogger("custom").info("test2"); //logged to console
The expected behaviour still works with version 1.5.4.
fupgang, marbon87, davey91 and sureshg