|
16 | 16 | <file>${LOG_PATH}/info.log</file> |
17 | 17 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
18 | 18 | <!--日志文件输出的文件名--> |
19 | | - <FileNamePattern>${LOG_PATH}/info.%d{yyyy-MM-dd}.log</FileNamePattern> |
| 19 | + <FileNamePattern>${LOG_PATH}/info.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern> |
20 | 20 | <!--日志文件保留天数--> |
21 | 21 | <maxHistory>60</maxHistory> |
22 | 22 | <totalSizeCap>30GB</totalSizeCap> |
| 23 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 24 | + <!--文件达到 最大128MB时会被压缩和切割 --> |
| 25 | + <maxFileSize>128MB</maxFileSize> |
| 26 | + </timeBasedFileNamingAndTriggeringPolicy> |
23 | 27 | </rollingPolicy> |
24 | 28 | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
25 | 29 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
26 | 30 | </encoder> |
27 | | - <!--日志文件最大的大小--> |
28 | | - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
29 | | - <MaxFileSize>30MB</MaxFileSize> |
30 | | - </triggeringPolicy> |
31 | 31 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
32 | 32 | <level>INFO</level> |
33 | 33 | <onMatch>ACCEPT</onMatch> |
|
38 | 38 | <file>${LOG_PATH}/warn.log</file> |
39 | 39 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
40 | 40 | <!--日志文件输出的文件名--> |
41 | | - <FileNamePattern>${LOG_PATH}/warn.%d{yyyy-MM-dd}.log</FileNamePattern> |
| 41 | + <FileNamePattern>${LOG_PATH}/warn.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern> |
42 | 42 | <!--日志文件保留天数--> |
43 | 43 | <maxHistory>60</maxHistory> |
44 | 44 | <totalSizeCap>30GB</totalSizeCap> |
| 45 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 46 | + <!--文件达到 最大128MB时会被压缩和切割 --> |
| 47 | + <maxFileSize>128MB</maxFileSize> |
| 48 | + </timeBasedFileNamingAndTriggeringPolicy> |
45 | 49 | </rollingPolicy> |
46 | 50 | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
47 | 51 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
48 | 52 | </encoder> |
49 | | - <!--日志文件最大的大小--> |
50 | | - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
51 | | - <MaxFileSize>32MB</MaxFileSize> |
52 | | - </triggeringPolicy> |
53 | 53 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
54 | 54 | <level>WARN</level> |
55 | 55 | <onMatch>ACCEPT</onMatch> |
|
60 | 60 | <file>${LOG_PATH}/error.log</file> |
61 | 61 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
62 | 62 | <!--日志文件输出的文件名--> |
63 | | - <FileNamePattern>${LOG_PATH}/error.%d{yyyy-MM-dd}.log</FileNamePattern> |
| 63 | + <FileNamePattern>${LOG_PATH}/error.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern> |
64 | 64 | <!--日志文件保留天数--> |
65 | 65 | <maxHistory>60</maxHistory> |
66 | 66 | <totalSizeCap>30GB</totalSizeCap> |
| 67 | + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 68 | + <!--文件达到 最大128MB时会被压缩和切割 --> |
| 69 | + <maxFileSize>128MB</maxFileSize> |
| 70 | + </timeBasedFileNamingAndTriggeringPolicy> |
67 | 71 | </rollingPolicy> |
68 | 72 | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
69 | 73 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
70 | 74 | </encoder> |
71 | | - <!--日志文件最大的大小--> |
72 | | - <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
73 | | - <MaxFileSize>32MB</MaxFileSize> |
74 | | - </triggeringPolicy> |
75 | 75 | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
76 | 76 | <level>ERROR</level> |
77 | 77 | <onMatch>ACCEPT</onMatch> |
|
80 | 80 | </appender> |
81 | 81 | <appender name="asyncFileAppender" class="ch.qos.logback.classic.AsyncAppender"> |
82 | 82 | <discardingThreshold>0</discardingThreshold> |
83 | | - <queueSize>500</queueSize> |
| 83 | + <queueSize>512</queueSize> |
84 | 84 | <appender-ref ref="INFO" /> |
85 | 85 | </appender> |
86 | 86 |
|
| 87 | + |
87 | 88 | <!-- 单独文件 --> |
88 | 89 | <!--<appender></appender>--> |
89 | 90 |
|
|
0 commit comments