From 8e1548568d7a884d8ba0bd817ab4819fdeaa6367 Mon Sep 17 00:00:00 2001 From: wangyan <405898180@qq.com> Date: Mon, 17 Nov 2025 16:20:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(logging):=20=E6=B7=BB=E5=8A=A0logback-spri?= =?UTF-8?q?ng.xml=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 - 配置控制台和文件两种日志输出方式 - 设置日志文件滚动策略,按时间和大小分割 - 指定日志格式和编码为UTF-8- 设置包级别和根日志级别为INFO - 配置日志文件最大历史保留30天,总大小上限3GB --- src/main/resources/logback-spring.xml | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/resources/logback-spring.xml diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..dae9aec --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,34 @@ + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + UTF-8 + + + + + + logs/app.log + + logs/app.%d{yyyy-MM-dd}.%i.log + 100MB + 30 + 3GB + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + UTF-8 + + + + + + + + + + + + \ No newline at end of file