chore: 系统调用日志输出到指定文件

This commit is contained in:
CaptainB 2021-12-20 16:47:03 +08:00 committed by shiziyuan9527
parent 6bf54034ed
commit 5ff12bd5dd
1 changed files with 33 additions and 0 deletions

View File

@ -141,6 +141,39 @@
<appender-ref ref="warnAppender"/> <appender-ref ref="warnAppender"/>
</appender> </appender>
<!-- 系统调用日志输出到指定文件 -->
<appender name="backendApiAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<File>${logging.file.path}/api/info.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${logging.file.path}/history/api/info.%d{yyyyMMdd}-%i.log
</FileNamePattern>
<maxHistory>30</maxHistory>
<TimeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</TimeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<Pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</Pattern>
</encoder>
</appender>
<appender name="backendApiAsyncAppender" class="ch.qos.logback.classic.AsyncAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<queueSize>10000</queueSize>
<appender-ref ref="backendApiAppender"/>
</appender>
<logger name="io.metersphere.controller.handler.WebLogAspect" additivity="false">
<level value="${logger.level:INFO}"/>
<appender-ref ref="backendApiAsyncAppender"/>
</logger>
<!-- 自定义测试计划执行的日志 --> <!-- 自定义测试计划执行的日志 -->
<appender name="infoTestPlanAppender" <appender name="infoTestPlanAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">