diff --git a/.gitignore b/.gitignore index 3ed6af4..47f4c10 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ build/ /docs/websocket-api.md /src/main/resources/static/ws-test.html /.omc/ +/logs/ diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 1085819..7016d97 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -21,20 +21,9 @@ logging: org.springframework: WARN # MyBatis 日志 org.mybatis: WARN - pattern: - # 控制台日志输出格式 - console: "%d{yyyy-MM-dd HH:mm:ss.SSS} | %clr(%-5level){highlight} %clr(${PID:- }){magenta} | %clr(%-15thread){yellow} %clr(%-50logger{50}){cyan} | %msg%n" - # 文件日志输出格式(不带颜色) - file: "%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5level ${PID:- } | %-15thread %-50logger{50} | %msg%n" file: # 日志文件存放路径 name: logs/keyborad-backend.log - # 日志文件滚动策略 - # 单个日志文件最大大小 - logback: - rollingpolicy: - max-file-size: 10MB - max-history: 30 # 用户配置 user: @@ -121,4 +110,4 @@ dromara: end-point: https://b632a61caa85401f63c9b32eef3a74c8.r2.cloudflarestorage.com/keyboardtest # 端点 bucket-name: keyboardtest #桶名称 domain: https://cdn.loveamorkey.com/ # 访问域名,注意末尾的'/',例如:https://abcd.s3.ap-east-1.amazonaws.com/ - base-path: tts/ # 基础路径 \ No newline at end of file + base-path: tts/ # 基础路径 diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..0c1dd1c --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + ${CONSOLE_PATTERN} + UTF-8 + + + + + ${LOG_FILE} + + ${FILE_PATTERN} + UTF-8 + + + ${ROLLING_FILE_PATTERN} + 10MB + 30 + + + + + + + +