diff --git a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/util/LogUtil.java b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/util/LogUtil.java index 267c4e0..b9f747b 100644 --- a/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/util/LogUtil.java +++ b/yexuejc-springboot-base/src/main/java/com/yexuejc/springboot/base/util/LogUtil.java @@ -13,15 +13,15 @@ public class LogUtil { /** * 用于记录访问日志,输出到access.log */ - public final static Logger accessLogger = LoggerFactory.getLogger("com.yexuejc.uselaw.access"); + public final static Logger accessLogger = LoggerFactory.getLogger("access"); /** * 用于记录业务日志,输出到biz.log */ - public final static Logger bizLogger = LoggerFactory.getLogger("com.yexuejc.uselaw.biz"); + public final static Logger bizLogger = LoggerFactory.getLogger("biz"); /** * 用于记录程序异常日志,输出到exception.log */ - public final static Logger exceptionLogger = LoggerFactory.getLogger("com.yexuejc.uselaw.exception"); + public final static Logger exceptionLogger = LoggerFactory.getLogger("exception"); /** * 格式化日志消息(将;替换为_) diff --git a/yexuejc-springboot-base/src/main/resources/logback-spring.xml b/yexuejc-springboot-base/src/main/resources/logback-spring.xml index 54e679b..fa08ca0 100644 --- a/yexuejc-springboot-base/src/main/resources/logback-spring.xml +++ b/yexuejc-springboot-base/src/main/resources/logback-spring.xml @@ -1,63 +1,72 @@ - - + + + + + + - - - - ${context.name} - - ${log.path}/access.log - - ${log.path}/access.${roll.file.suffix} - - - - ${log.pattern} - - - - ${log.path}/biz.log - - ${log.path}/biz.${roll.file.suffix} - - - - ${log.pattern} - - - - ${log.path}/exception.log - - ${log.path}/exception.${roll.file.suffix} - - - - ${log.pattern} - - - - - - - - - - - - - - - - ${log.pattern} - - - - - + + + ${context.name} + + ${log.path}/access.log + + ${log.path}/access.${roll.file.suffix} + + + + ${log.pattern} + + + + ${log.path}/biz.log + + ${log.path}/biz.${roll.file.suffix} + + + + ${log.pattern} + + + + ${log.path}/exception.log + + ${log.path}/exception.${roll.file.suffix} + + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + ${log.pattern} + + + + + diff --git a/yexuejc-springboot-base/src/test/resources/application.properties b/yexuejc-springboot-base/src/test/resources/application.properties index 00d3c94..308233e 100644 --- a/yexuejc-springboot-base/src/test/resources/application.properties +++ b/yexuejc-springboot-base/src/test/resources/application.properties @@ -1,5 +1,9 @@ server.port=8888 +spring.application.name=@pom.artifactId@ + +#log logging.level.root=info +logging.path=/logs/yexuejc-springboot-base yexuejc.http.filter.type=0