springboot---logback的整合配置

2020-12-13 06:04

阅读:269

标签:end   style   src   配置文档   logger   inf   you   pom   alt   

1.pom.xml


org.codehaus.groovy
groovy
${groovy.version}

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"])

 

springboot---logback的整合配置

标签:end   style   src   配置文档   logger   inf   you   pom   alt   

原文地址:https://www.cnblogs.com/gxyjava/p/11165471.html


评论


亲,登录后才可以留言!