[logback-user] Add a ContextListener in Groovy Config

Pepper Lebeck-Jobe eljobe at gmail.com
Wed Feb 22 03:13:11 CET 2012


Took me a while, but it looks like this works:

import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.jul.LevelChangePropagator
import ch.qos.logback.core.ConsoleAppender

import static ch.qos.logback.classic.Level.INFO

context = new LevelChangePropagator()
context.resetJUL = true

appender("STDOUT", ConsoleAppender) {
 encoder(PatternLayoutEncoder) {
   pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
 }
}
root(INFO, ["STDOUT"])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120221/3f66f420/attachment.html>


More information about the Logback-user mailing list