Showing
1 changed file
with
20 additions
and
10 deletions
@@ -33,11 +33,15 @@ | @@ -33,11 +33,15 @@ | ||
33 | <!-- DEBUG、INFO、WARN、ERROR级别日志 appender --> | 33 | <!-- DEBUG、INFO、WARN、ERROR级别日志 appender --> |
34 | <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender"> | 34 | <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
35 | <file>/Data/logs/yoho-datasync-producer/debug.log</file> | 35 | <file>/Data/logs/yoho-datasync-producer/debug.log</file> |
36 | - <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 36 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
37 | <!-- daily rollover --> | 37 | <!-- daily rollover --> |
38 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/debug.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 38 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/debug.%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
39 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
40 | + <!-- or whenever the file size reaches 100MB --> | ||
41 | + <maxFileSize>${maxFileSize}</maxFileSize> | ||
42 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
43 | + <!-- keep 30 days' worth of history --> | ||
39 | <maxHistory>${maxHistory}</maxHistory> | 44 | <maxHistory>${maxHistory}</maxHistory> |
40 | - <maxFileSize>${maxFileSize}</maxFileSize> | ||
41 | </rollingPolicy> | 45 | </rollingPolicy> |
42 | <encoder> | 46 | <encoder> |
43 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | 47 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
@@ -53,12 +57,15 @@ | @@ -53,12 +57,15 @@ | ||
53 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | 57 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
54 | <level>INFO</level> | 58 | <level>INFO</level> |
55 | </filter> | 59 | </filter> |
56 | - <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
57 | - <!-- 按天回滚 daily --> | 60 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
61 | + <!-- daily rollover --> | ||
58 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/info.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 62 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/info.%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
59 | - <!-- 日志最大的保存天数 --> | 63 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
64 | + <!-- or whenever the file size reaches 100MB --> | ||
65 | + <maxFileSize>${maxFileSize}</maxFileSize> | ||
66 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
67 | + <!-- keep 30 days' worth of history --> | ||
60 | <maxHistory>${maxHistory}</maxHistory> | 68 | <maxHistory>${maxHistory}</maxHistory> |
61 | - <maxFileSize>${maxFileSize}</maxFileSize> | ||
62 | </rollingPolicy> | 69 | </rollingPolicy> |
63 | <encoder> | 70 | <encoder> |
64 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | 71 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
@@ -74,12 +81,15 @@ | @@ -74,12 +81,15 @@ | ||
74 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | 81 | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
75 | <level>WARN</level> | 82 | <level>WARN</level> |
76 | </filter> | 83 | </filter> |
77 | - <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
78 | - <!-- 按天回滚 daily --> | 84 | + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
85 | + <!-- daily rollover --> | ||
79 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/warn.%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 86 | <fileNamePattern>/Data/logs/yoho-datasync-producer/archived/warn.%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
80 | - <!-- 日志最大的保存天数 --> | 87 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
88 | + <!-- or whenever the file size reaches 100MB --> | ||
89 | + <maxFileSize>${maxFileSize}</maxFileSize> | ||
90 | + </timeBasedFileNamingAndTriggeringPolicy> | ||
91 | + <!-- keep 30 days' worth of history --> | ||
81 | <maxHistory>${maxHistory}</maxHistory> | 92 | <maxHistory>${maxHistory}</maxHistory> |
82 | - <maxFileSize>${maxFileSize}</maxFileSize> | ||
83 | </rollingPolicy> | 93 | </rollingPolicy> |
84 | <encoder> | 94 | <encoder> |
85 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> | 95 | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
-
Please register or login to post a comment