From 086dea859498ba0d448b57a1532023e21642224c Mon Sep 17 00:00:00 2001 From: JoeyZhou Date: Mon, 31 Mar 2025 23:58:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E7=94=9F=E6=88=90bug?= =?UTF-8?q?=EF=BC=8C=E9=87=87=E7=94=A8logback=E6=8E=A7=E5=88=B6=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 9 ++ .../src/main/resources/logback-spring.xml | 128 ++++++++++++++---- 2 files changed, 109 insertions(+), 28 deletions(-) diff --git a/main/manager-api/src/main/resources/application.yml b/main/manager-api/src/main/resources/application.yml index 902b5198..66662a78 100644 --- a/main/manager-api/src/main/resources/application.yml +++ b/main/manager-api/src/main/resources/application.yml @@ -65,5 +65,14 @@ mybatis-plus: blobType: BLOB boolValue: TRUE +# 添加日志相关配置 +logging: + config: classpath:logback-spring.xml + file: + path: ./logs + level: + root: info + xiaozhi: debug + app: fronted-url: http://localhost:8001 \ No newline at end of file diff --git a/main/manager-api/src/main/resources/logback-spring.xml b/main/manager-api/src/main/resources/logback-spring.xml index 68ea4cf6..add76cf6 100644 --- a/main/manager-api/src/main/resources/logback-spring.xml +++ b/main/manager-api/src/main/resources/logback-spring.xml @@ -1,35 +1,107 @@ - - - - - + + + + + + + + + + + + ${LOG_HOME} + true + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}) - %msg%n + UTF-8 + + + + + + ${LOG_HOME}/xiaozhi-esp32-api.log + + ${LOG_HOME}/xiaozhi-esp32-api.%d{yyyy-MM-dd}.%i.log + 10MB + 30 + 2GB + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + + ${LOG_HOME}/error.log + + ERROR + + + ${LOG_HOME}/error.%d{yyyy-MM-dd}.%i.log + 10MB + 30 + 1GB + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + - - + + + + + + + + - - + + + + + + + + + + + + + + - - - - /system/logs/admin.%d{yyyy-MM-dd}.%i.log - - 1MB - - 7 - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n - - - - - + + + + + + + + + + - - \ No newline at end of file + + + + true + +