meta/logback.groovy

20 lines
563 B
Groovy
Raw Normal View History

2024-06-07 11:54:23 -04:00
import ch.qos.logback.core.joran.spi.ConsoleTarget
import ch.qos.logback.core.ConsoleAppender
def environment = System.getenv("ENVIRONMENT") ?: "production"
def defaultLevel = INFO
def defaultTarget = ConsoleTarget.SystemErr
appender("CONSOLE", ConsoleAppender) {
encoder(PatternLayoutEncoder) {
pattern = "WAWA:: %boldGreen(%d{yyyy-MM-dd}) %boldYellow(%d{HH:mm:ss}) %gray(|) %highlight(%5level) %gray(|) %boldMagenta(%40.40logger{40}) %gray(|) %msg%n"
withJansi = true
}
target = defaultTarget
}
root(defaultLevel, ["CONSOLE"])