chapters.filters.mdcfilter.xml Maven / Gradle / Ivy
<configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %X{testKey} - %msg%n"</Pattern> </layout> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> <Name>myFilter</Name> <OnMatch>DENY</OnMatch> <Evaluator class="ch.qos.logback.classic.boolex.JaninoEventEvaluator"> <Name>mdcEvaluator</Name> <Expression>mdc!=null && "val".equals(mdc.get("key"))</Expression> </Evaluator> </filter> </appender> <root level="debug"> <appender-ref ref="STDOUT" /> </root> </configuration>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy