|
|
1
|
+<configuration>
|
|
|
2
|
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
|
|
3
|
+ <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
|
|
|
4
|
+ <evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
|
|
|
5
|
+ <expression>logger.contains("springframework")</expression>
|
|
|
6
|
+ </evaluator>
|
|
|
7
|
+ <OnMismatch>NEUTRAL</OnMismatch>
|
|
|
8
|
+ <OnMatch>DENY</OnMatch>
|
|
|
9
|
+ </filter>
|
|
|
10
|
+
|
|
|
11
|
+ <encoder charset="UTF-8">
|
|
|
12
|
+ <pattern>%-4r - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n </pattern>
|
|
|
13
|
+ </encoder>
|
|
|
14
|
+ </appender>
|
|
|
15
|
+
|
|
|
16
|
+ <appender name="PETSTORE-ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
17
|
+ <file>${petstore.log.root}/petstore-all.log</file>
|
|
|
18
|
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
19
|
+ <fileNamePattern>petstore-all.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
|
|
|
20
|
+ </rollingPolicy>
|
|
|
21
|
+ <encoder>
|
|
|
22
|
+ <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
|
|
|
23
|
+ </encoder>
|
|
|
24
|
+ </appender>
|
|
|
25
|
+
|
|
|
26
|
+ <appender name="PETSTORE-TIMEOUT-SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
27
|
+ <file>${petstore.log.root}/petstore-timeout-sql.log</file>
|
|
|
28
|
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
29
|
+ <fileNamePattern>petstore-timeout-sql.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
|
|
|
30
|
+ </rollingPolicy>
|
|
|
31
|
+ <encoder>
|
|
|
32
|
+ <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
|
|
|
33
|
+ </encoder>
|
|
|
34
|
+ </appender>
|
|
|
35
|
+
|
|
|
36
|
+ <appender name="PETSTORE-TIMEOUT-REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
|
37
|
+ <file>${petstore.log.root}/petstore-timeout-request.log</file>
|
|
|
38
|
+ <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
|
39
|
+ <fileNamePattern>petstore-timeout-request.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
|
|
|
40
|
+ </rollingPolicy>
|
|
|
41
|
+
|
|
|
42
|
+ <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
|
|
43
|
+ <maxFileSize>5MB</maxFileSize>
|
|
|
44
|
+ </triggeringPolicy>
|
|
|
45
|
+
|
|
|
46
|
+ <encoder>
|
|
|
47
|
+ <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
|
|
|
48
|
+ </encoder>
|
|
|
49
|
+ </appender>
|
|
|
50
|
+
|
|
|
51
|
+ <!-- ===================================================================== -->
|
|
|
52
|
+ <!-- 以下是logger的定义 -->
|
|
|
53
|
+ <!-- ===================================================================== -->
|
|
|
54
|
+ <logger name="com.taobao.sample.petstore.dal.dao.ibatis.IbatisGenericDaoImpl" additivity="true">
|
|
|
55
|
+ <level value="DEBUG"/>
|
|
|
56
|
+ <appender-ref ref="PETSTORE-TIMEOUT-SQL"/>
|
|
|
57
|
+ </logger>
|
|
|
58
|
+
|
|
|
59
|
+ <logger name="com.milanoo.zeus.web.filter.timer.TimerFilter" additivity="true">
|
|
|
60
|
+ <level value="WARN"/>
|
|
|
61
|
+ <appender-ref ref="PETSTORE-TIMEOUT-REQUEST"/>
|
|
|
62
|
+ </logger>
|
|
|
63
|
+
|
|
|
64
|
+ <!-- ===================================================================== -->
|
|
|
65
|
+ <!-- Root logger的定义 -->
|
|
|
66
|
+ <!-- ===================================================================== -->
|
|
|
67
|
+ <root level="${petstore.log.level}">
|
|
|
68
|
+ <appender-ref ref="STDOUT" />
|
|
|
69
|
+ <appender-ref ref="PETSTORE-ALL" />
|
|
|
70
|
+ </root>
|
|
|
71
|
+</configuration> |