logback.xml
3.04 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- web 日志 -->
<appender name="ORDERS-WEB"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- <file>${catalina.base}/logs/orders_web.log</file> -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${catalina.base}/logs/%d{yyyy-MM-dd}/orders_web.%i.log.zip
</FileNamePattern>
<MaxHistory>30</MaxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>[orders-web] %date %-5level [%thread] %logger{36}
[%file:%line] %msg%n</pattern>
</encoder>
</appender>
<!-- api 接口日志 -->
<appender name="ORDERS-API"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/api/orders_api.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${catalina.base}/logs/api/%d{yyyy-MM-dd}/orders_api_%i.log.zip
</FileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>[orders-api] %date %-5level [%thread] %logger{36}
[%file:%line] %msg%n</pattern>
</encoder>
</appender>
<logger name="com.b2c.dtms.web.restful" level="INFO" additivity="false">
<appender-ref ref="ORDERS-API" />
</logger>
<logger name="com.b2c.dtms.web.common.ApiCallMonitorAspect"
level="INFO" additivity="false">
<appender-ref ref="ORDERS-API" />
</logger>
<logger name="com.b2c.dtms.service.restful.impl" level="INFO"
additivity="false">
<appender-ref ref="ORDERS-API" />
</logger>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[orders] %d{yyyy-MM-dd HH:mm:ss.SSS}:[%thread] %-5level
%logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.b2c.dtms.dao" level="INFO">
<appender-ref ref="ORDERS-WEB" />
</logger>
<logger name="org.apache.ibatis" level="DEBUG">
<appender-ref ref="STDOUT" />
</logger>
<logger name="com.ibatis" level="DEBUG" />
<logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" />
<logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" />
<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate"
level="DEBUG" />
<logger name="java.sql.Connection" level="DEBUG" />
<logger name="java.sql.Statement" level="DEBUG" />
<logger name="java.sql.PreparedStatement" level="DEBUG" />
<root level="INFO">
<!-- <appender-ref ref="ORDERS-WEB" /> -->
<appender-ref ref="STDOUT" />
<appender-ref ref="org.apache.ibatis" />
<appender-ref ref="com.ibatis.common" />
<appender-ref ref="com.ibatis.common.jdbc.ScriptRunner" />
<appender-ref ref="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" />
<appender-ref ref="java.sql" />
</root>
</configuration>