日志记录修改

This commit is contained in:
2025-10-30 17:11:32 +08:00
parent b808bcf092
commit 8cd69d05c7

View File

@@ -6,7 +6,6 @@
<property name="log.path" value="./log" />
<!-- 日志输出格式 -->
<!--value为输出格式设置用正则表达式格式化 d:时间 -->
<!--<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %-5level %logger{36} - [%method,%line] - %msg%n" />-->
<property name="log.pattern.console" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
<property name="log.pattern.file" value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%15t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
@@ -32,12 +31,8 @@
<encoder>
<pattern>${log.pattern.file}</pattern>
</encoder>
<!--LevelFilter过滤器对指定level的日志进行记录或不记录
对不等于指定level的日志不记录或记录-->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 只会打印debug不会有info日志-->
<!-- <level>DEBUG</level>-->
<!-- 匹配时的操作:接收(记录) -->
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
@@ -72,12 +67,9 @@
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn" />
<!-- 统一的root配置 -->
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>