logback.xml
3.31 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
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
<expression>logger.contains("springframework")</expression>
</evaluator>
<OnMismatch>NEUTRAL</OnMismatch>
<OnMatch>DENY</OnMatch>
</filter>
<encoder charset="UTF-8">
<pattern>%-4r - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n </pattern>
</encoder>
</appender>
<appender name="PETSTORE-ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${petstore.log.root}/petstore-all.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>petstore-all.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
</encoder>
</appender>
<appender name="PETSTORE-TIMEOUT-SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${petstore.log.root}/petstore-timeout-sql.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>petstore-timeout-sql.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
</encoder>
</appender>
<appender name="PETSTORE-TIMEOUT-REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${petstore.log.root}/petstore-timeout-request.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>petstore-timeout-request.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
</encoder>
</appender>
<!-- ===================================================================== -->
<!-- 以下是logger的定义 -->
<!-- ===================================================================== -->
<logger name="com.taobao.sample.petstore.dal.dao.ibatis.IbatisGenericDaoImpl" additivity="true">
<level value="DEBUG"/>
<appender-ref ref="PETSTORE-TIMEOUT-SQL"/>
</logger>
<logger name="com.milanoo.zeus.web.filter.timer.TimerFilter" additivity="true">
<level value="WARN"/>
<appender-ref ref="PETSTORE-TIMEOUT-REQUEST"/>
</logger>
<!-- ===================================================================== -->
<!-- Root logger的定义 -->
<!-- ===================================================================== -->
<root level="${petstore.log.level}">
<appender-ref ref="STDOUT" />
<appender-ref ref="PETSTORE-ALL" />
</root>
</configuration>