...
|
...
|
@@ -21,39 +21,46 @@ |
|
|
</encoder>
|
|
|
</appender>
|
|
|
|
|
|
<!-- WARN级别日志 appender -->
|
|
|
<appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<file>/Data/tomcat_logs/monitor/warn-log</file>
|
|
|
<!-- 过滤器,过滤掉 TRACE 和 DEBUG 和 INFO 级别的日志 -->
|
|
|
<file>${catalina.home}/logs/warn.log</file>
|
|
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
|
<level>WARN</level>
|
|
|
<level>ERROR</level>
|
|
|
</filter>
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
<!-- 按天回滚 daily -->
|
|
|
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/warn-log.log</fileNamePattern>
|
|
|
<!-- 日志最大的保存天数 -->
|
|
|
<!-- daily rollover -->
|
|
|
<fileNamePattern>
|
|
|
${catalina.home}/logs/warn.%d{yyyy-MM-dd}.%i.log.gz
|
|
|
</fileNamePattern>
|
|
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
|
|
<!-- or whenever the file size reaches 100MB -->
|
|
|
<maxFileSize>${maxFileSize}</maxFileSize>
|
|
|
</timeBasedFileNamingAndTriggeringPolicy>
|
|
|
<!-- keep 30 days' worth of history -->
|
|
|
<maxHistory>${maxHistory}</maxHistory>
|
|
|
</rollingPolicy>
|
|
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
|
|
<maxFileSize>${maxFileSize}</maxFileSize>
|
|
|
</triggeringPolicy>
|
|
|
<encoder>
|
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
|
|
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}:%line -- %msg%n</pattern>
|
|
|
</encoder>
|
|
|
</appender>
|
|
|
|
|
|
<!-- DEBUG级别日志 appender -->
|
|
|
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<file>/Data/tomcat_logs/monitor/debug-log</file>
|
|
|
<file>${catalina.home}/logs/debug.log</file>
|
|
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
|
<level>INFO</level>
|
|
|
</filter>
|
|
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
<!-- 按天回滚 daily -->
|
|
|
<fileNamePattern>${catalina.home}/logs/%d{yyyy-MM-dd}/debug-log.log</fileNamePattern>
|
|
|
<fileNamePattern>
|
|
|
${catalina.home}/logs/debug.%d{yyyy-MM-dd}.%i.log.gz
|
|
|
</fileNamePattern>
|
|
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
|
|
<!-- or whenever the file size reaches 100MB -->
|
|
|
<maxFileSize>${maxFileSize}</maxFileSize>
|
|
|
</timeBasedFileNamingAndTriggeringPolicy>
|
|
|
<!-- 日志最大的历史 60天 -->
|
|
|
<maxHistory>${maxHistory}</maxHistory>
|
|
|
</rollingPolicy>
|
|
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
|
|
<maxFileSize>${maxFileSize}</maxFileSize>
|
|
|
</triggeringPolicy>
|
|
|
<encoder>
|
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
|
|
|
</encoder>
|
...
|
...
|
|