标签:end style src 配置文档 logger inf you pom alt
1.pom.xml
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
2.新增一个logback.groovy的配置文档
def WEBAPP_DIR = "."
appender("CONSOLE", ConsoleAppender) {
encoder(PatternLayoutEncoder) {
pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
}
}
appender("FILE", RollingFileAppender) {
file = "logFile.log"
rollingPolicy(TimeBasedRollingPolicy) {
fileNamePattern = "logFile.%d{yyyy-MM-dd}.log"
maxHistory = 30
totalSizeCap = "3GB"
}
encoder(PatternLayoutEncoder) {
pattern = "%-4relative [%thread] %-5level %logger{35} - %msg%n"
}
}
root(DEBUG, ["CONSOLE","ROLLING"])
标签:end style src 配置文档 logger inf you pom alt
原文地址:https://www.cnblogs.com/gxyjava/p/11165471.html