Created
August 3, 2016 21:50
-
-
Save finnjohnsen/87b14223aba07cf5f7c3c84c4f474e0f to your computer and use it in GitHub Desktop.
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
import ch.qos.logback.classic.boolex.GEventEvaluator | |
import ch.qos.logback.classic.encoder.PatternLayoutEncoder | |
import ch.qos.logback.core.ConsoleAppender | |
import ch.qos.logback.core.filter.EvaluatorFilter | |
import static ch.qos.logback.classic.Level.DEBUG | |
import static ch.qos.logback.core.spi.FilterReply.DENY | |
import static ch.qos.logback.core.spi.FilterReply.NEUTRAL | |
appender("CONSOLE", ConsoleAppender) { | |
encoder(PatternLayoutEncoder) { | |
pattern = "[%thread] %-5level %logger{15} - %msg %n" } | |
filter(EvaluatorFilter) { | |
evaluator(GEventEvaluator) { | |
expression = "!(e.getLoggerName().contains('com.finnjohnsen'))" } | |
onMismatch = DENY onMatch = NEUTRAL } | |
} | |
appender("COLOR_CONSOLE", ConsoleAppender) { | |
withJansi = true encoder(PatternLayoutEncoder) { | |
pattern = "[%thread] %highlight(%-5level) %boldWhite(%logger{15}) - %boldYellow(%msg) %n" } | |
} | |
root(DEBUG, ["CONSOLE"]) | |
logger("com.finnjohnsen", DEBUG, ["COLOR_CONSOLE"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment