-
Notifications
You must be signed in to change notification settings - Fork 0
/
logback-spring.xml
37 lines (33 loc) · 1.45 KB
/
logback-spring.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="UTF-8"?>
<configuration scanPeriod="30 seconds" scan="true">
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<property value="spring-boot-example.log" name="LOG_FILE"/>
<property value="10MB" name="LOG_FILE_MAX_SIZE"/>
<property value="8GB" name="TOTAL_SIZE_CAP"/>
<property value="20000" name="LOG_FILE_MAX_HISTORY"/>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<file>${LOG_PATH}/${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}/${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>${LOG_FILE_MAX_SIZE:-10MB}</maxFileSize>
<maxHistory>${LOG_FILE_MAX_HISTORY:-0}</maxHistory>
<totalSizeCap>${TOTAL_SIZE_CAP:-0}</totalSizeCap>
</rollingPolicy>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<logger name="com.zecops" level="INFO" additivity="false">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
</logger>
<root level="INFO">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>