-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogback-spring.xml
85 lines (78 loc) · 3.65 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName>
<!-- 动态日志级别 -->
<jmxConfigurator/>
<!-- 定义日志文件 输出位置 -->
<property name="log.path" value="logs/dca-gateway"/>
<property name="log.name" value="dca-gateway"/>
<property name="log.monitor" value="appmonitor"/>
<property name="log.maxSize" value="1GB"/>
<property name="log.maxHistory" value="3650"/>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%level][%d{yyyy-MM-dd HH:mm:ss.SSS}][%thread] %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/${log.name}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/${log.name}.log.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxHistory>${log.maxHistory}</maxHistory>
<maxFileSize>${log.maxSize}</maxFileSize>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${log.maxSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>[%level][%d{yyyy-MM-dd HH:mm:ss.SSS}][%thread]%msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="monitor" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/${log.monitor}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/${log.monitor}.log.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxHistory>${log.maxHistory}</maxHistory>
<maxFileSize>${log.maxSize}</maxFileSize>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>${log.maxSize}</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>[%level][%d{yyyy-MM-dd HH:mm:ss.SSS}][%thread]%msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</root>
<logger name="com.webank.blockchain.dca.gateway.controller" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</logger>
<logger name="com.webank.blockchain.dca.gateway.service" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</logger>
<logger name="com.webank.blockchain.dca.gateway.task" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</logger>
<logger name="com.webank.blockchain.dca.gateway.monitor" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="monitor"/>
<appender-ref ref="console"/>
</logger>
<logger name="com.webank.blockchain.dca.gateway.advice" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</logger>
<logger name="com.webank.blockchain.dca.gateway.aspect" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
</logger>
</configuration>