Created
July 25, 2017 19:42
-
-
Save jeroenr/e5e54af6bc1868216a9da58f1e2f5984 to your computer and use it in GitHub Desktop.
Logback configuration splitting to stdout and stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender"> | |
<target>System.err</target> | |
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | |
<level>WARN</level> | |
</filter> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<target>System.out</target> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>DEBUG</level> | |
<onMatch>ACCEPT</onMatch> | |
</filter> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>INFO</level> | |
<onMatch>ACCEPT</onMatch> | |
</filter> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>TRACE</level> | |
<onMatch>ACCEPT</onMatch> | |
</filter> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>WARN</level> | |
<onMatch>DENY</onMatch> | |
</filter> | |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | |
<level>ERROR</level> | |
<onMatch>DENY</onMatch> | |
</filter> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<root level="INFO"> | |
<appender-ref ref="STDOUT" /> | |
<appender-ref ref="STDERR" /> | |
</root> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks