...
|
...
|
@@ -67,7 +67,7 @@ |
|
|
</appender>
|
|
|
|
|
|
<!-- 按照每天生成日志文件 -->
|
|
|
<appender name="APP_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<appender name="APP_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<file>${catalina.home}/logs/app.log</file>
|
|
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
|
<level>INFO</level>
|
...
|
...
|
@@ -88,10 +88,10 @@ |
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level - %msg%n</pattern>
|
|
|
</encoder>
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
<!-- 按照每天生成日志文件 -->
|
|
|
<appender name="BAN_IP_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
|
|
|
|
|
|
<!-- 按照每天生成日志文件 -->
|
|
|
<appender name="BAN_IP_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<file>${catalina.home}/logs/banIP.log</file>
|
|
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
|
<level>INFO</level>
|
...
|
...
|
@@ -112,25 +112,52 @@ |
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level - %msg%n</pattern>
|
|
|
</encoder>
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- root级别 DEBUG -->
|
|
|
<root level="INFO">
|
|
|
<!-- 控制台输出 -->
|
|
|
<appender-ref ref="STDOUT" />
|
|
|
<appender-ref ref="STDOUT"/>
|
|
|
<!-- 文件输出 -->
|
|
|
<appender-ref ref="DEBUG" />
|
|
|
<appender-ref ref="WARN" />
|
|
|
<appender-ref ref="DEBUG"/>
|
|
|
<appender-ref ref="WARN"/>
|
|
|
</root>
|
|
|
|
|
|
<logger name="appLogger" additivity="false">
|
|
|
<level value="INFO"/>
|
|
|
<appender-ref ref="APP_LOG"/>
|
|
|
</logger>
|
|
|
|
|
|
<logger name="banIPLogger" additivity="false">
|
|
|
|
|
|
<logger name="banIPLogger" additivity="false">
|
|
|
<level value="INFO"/>
|
|
|
<appender-ref ref="BAN_IP_LOG"/>
|
|
|
</logger>
|
|
|
|
|
|
<!-- 按照每天生成日志文件 -->
|
|
|
<appender name="API_TEST_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
<file>${catalina.home}/logs/apiTest.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/apiTest.%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>
|
|
|
<encoder>
|
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level - %msg%n</pattern>
|
|
|
</encoder>
|
|
|
</appender>
|
|
|
<logger name="apiTestLogger" additivity="false">
|
|
|
<level value="INFO"/>
|
|
|
<appender-ref ref="API_TEST_LOG"/>
|
|
|
</logger>
|
|
|
|
|
|
</configuration> |
|
|
\ No newline at end of file |
...
|
...
|
|