-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogback-spring.xml
36 lines (30 loc) · 1.3 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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOGS" value="./logs"/>
<appender name="RollingFile"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOGS}/domiot-backend.log</file>
<encoder
class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d %p %C{1} [%t] %m%n</Pattern>
</encoder>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- rollover daily and when the file reaches 10 MegaBytes -->
<fileNamePattern>${LOGS}/archived/domiot-backend-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!-- each archived file, size max 10MB -->
<maxFileSize>10MB</maxFileSize>
<!-- total size of all archive files, if total size > 1GB, it will delete old archived file -->
<totalSizeCap>1GB</totalSizeCap>
<!-- 10 days to keep -->
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<!-- LOG everything at INFO level -->
<root level="debug">
<appender-ref ref="RollingFile"/>
</root>
<logger name="org.domiot" level="debug" additivity="false">
<appender-ref ref="RollingFile"/>
</logger>
</configuration>