优化logback日志

This commit is contained in:
paulGao
2021-09-30 14:48:53 +08:00
parent cdeebc7afb
commit 0440ecea23
12 changed files with 103 additions and 74 deletions

View File

@@ -22,6 +22,8 @@ management:
exposure:
include: '*'
spring:
application:
name: manager-api
# 要在其中注册的Spring Boot Admin Server的URL。
boot:
admin:
@@ -166,6 +168,7 @@ mybatis-plus:
# 日志
logging:
config: classpath:logback-spring.xml
# 输出级别
level:
cn.lili: info
@@ -175,10 +178,12 @@ logging:
file:
# 指定路径
path: lili-logs
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-size: 5MB
logback:
rollingpolicy:
# 最大保存天数
max-history: 7
# 每个文件最大大小
max-file-size: 5MB
#加密参数
jasypt:
encryptor:

View File

@@ -4,9 +4,9 @@
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--应用名称-->
<property name="APP_NAME" value="common-api"/>
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<property name="LOG_FILE_PATH" value="lili-logs"/>
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<contextName>${APP_NAME}</contextName>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">