完善日志系统

This commit is contained in:
2023-10-16 19:41:11 +08:00
parent 2b42b371a1
commit 71a289801c
2 changed files with 17 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ logging:
max-file-size: 100MB max-file-size: 100MB
clean-history-on-start: true clean-history-on-start: true
max-history: 7 max-history: 7
config: classpath:logback-spring.xml
springdoc: springdoc:
swagger-ui: swagger-ui:
enabled: false enabled: false

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="app" source="spring.application.name"
defaultValue="spring"/>
<springProperty scope="context" name="profile" source="spring.profiles.active" defaultValue="default"/>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property name="LOG_FILE" value="${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/${app}-${profile}.log"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<include resource="org/springframework/boot/logging/logback/file-appender.xml"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
<logger name="org.springframework.web" level="DEBUG"/>
</configuration>