From d5a42a92df8817ece8d4e0a9c19cfbcc2f4055e1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 26 Apr 2021 20:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A2=B3=E7=90=86=20logback-spring.xml=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-local.yaml | 4 +-- src/main/resources/logback-spring.xml | 30 +++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/main/resources/application-local.yaml b/src/main/resources/application-local.yaml index fd25bfc64..9c30bf9f5 100644 --- a/src/main/resources/application-local.yaml +++ b/src/main/resources/application-local.yaml @@ -145,8 +145,8 @@ spring: # 日志文件配置 logging: file: - path: ${user.home}/logs/ # 日志文件的路径 - name: ${spring.application.name} # 日志文件名 +# path: ${user.home}/logs/ # 日志文件的路径 + name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 --- #################### 芋道相关配置 #################### diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 49eb3c249..fb75bc3b1 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -1,7 +1,11 @@ - + + + - + + +       @@ -13,22 +17,34 @@ + ${PATTERN_DEFAULT} + + ${LOG_FILE} - ${LOG_FILE}.%d{yyyy-MM-dd}.%i.log} - 10MB - 7 - false + + ${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz} + + ${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false} + + ${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB} + + ${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0} + + ${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30} + + 0 - 10 + + 256