Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 616 Bytes

README.md

File metadata and controls

21 lines (18 loc) · 616 Bytes

Logback4k

compile 'com.github.christophpickl.kpotpourri:logback4k:$versionKPotpourri'

Simple way to programmatically configure logback, instead of using plain XML files.

import ch.qos.logback.classic.Level
import com.github.christophpickl.kpotpourri.logback4k.Logback4k

Logback4k.reconfigure { 
    rootLevel = Level.ALL
    packageLevel(Level.WARN, "org.apache", "org.jetty")
    addConsoleAppender { 
        appenderName = "myAppender"
        level = Level.ALL // by default
        pattern = "%-43(%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread]) [%-5level] %logger{42} - %msg%n"
    }
}