Authored by liangyi.chen@yoho.cn

日志优化

... ... @@ -33,13 +33,11 @@
<!-- DEBUG、INFO、WARN、ERROR级别日志 appender -->
<appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/Data/logs/yoho-datasync-consumer/debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- daily rollover -->
<fileNamePattern>/Data/logs/yoho-datasync-consumer/archived/debug.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
<!-- keep 30 days' worth of history -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
... ... @@ -57,15 +55,13 @@
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 按天回滚 daily -->
<fileNamePattern>/Data/logs/yoho-datasync-consumer/archived/info.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
</rollingPolicy>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
... ... @@ -80,15 +76,13 @@
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- 按天回滚 daily -->
<fileNamePattern>/Data/logs/yoho-datasync-consumer/archived/warn.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- 日志最大的保存天数 -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>${maxFileSize}</maxFileSize>
</triggeringPolicy>
</rollingPolicy>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
... ... @@ -99,13 +93,10 @@
<!-- 数据检测相关日志 -->
<appender name="DATA_CHECKERROR_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/Data/logs/yoho-datasync-consumer/datacheck-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- daily rollover -->
<fileNamePattern>/Data/logs/yoho-datasync-consumer/archived/datacheck-error.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>${maxFileSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxFileSize>${maxFileSize}</maxFileSize>
<!-- keep 30 days' worth of history -->
<maxHistory>${maxHistory}</maxHistory>
</rollingPolicy>
... ...