commit | author | age
|
a18bfa
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
Z |
2 |
<configuration debug="false"> |
|
3 |
<property name="LOG_HOME" value="./log" /> |
|
4 |
<!-- 控制台输出 --> |
|
5 |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
|
6 |
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
|
7 |
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --> |
|
8 |
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|
9 |
</encoder> |
|
10 |
</appender> |
|
11 |
<!-- 按照每天生成日志文件 --> |
|
12 |
<appender name="FILE" |
|
13 |
class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
14 |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
15 |
<!--日志文件输出的文件名 --> |
|
16 |
<FileNamePattern>${LOG_HOME}/autoForm-info.log.%d{yyyy-MM-dd}.log |
|
17 |
</FileNamePattern> |
|
18 |
<!--日志文件保留天数 --> |
|
19 |
<MaxHistory>30</MaxHistory> |
|
20 |
</rollingPolicy> |
|
21 |
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
|
22 |
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --> |
|
23 |
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|
24 |
</encoder> |
|
25 |
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|
26 |
<level>INFO</level> |
|
27 |
<onMatch>ACCEPT</onMatch> |
|
28 |
<onMismatch>DENY</onMismatch> |
|
29 |
</filter> |
|
30 |
<!--日志文件最大的大小 --> |
|
31 |
<triggeringPolicy |
|
32 |
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
|
33 |
<MaxFileSize>10MB</MaxFileSize> |
|
34 |
</triggeringPolicy> |
|
35 |
</appender> |
|
36 |
|
|
37 |
<!-- 按照每天生成日志文件 --> |
|
38 |
<appender name="FILESQL" |
|
39 |
class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
40 |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
41 |
<!--日志文件输出的文件名 --> |
|
42 |
<FileNamePattern>${LOG_HOME}/autoForm-sql.log.%d{yyyy-MM-dd}.log |
|
43 |
</FileNamePattern> |
|
44 |
<!--日志文件保留天数 --> |
|
45 |
<MaxHistory>30</MaxHistory> |
|
46 |
</rollingPolicy> |
|
47 |
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
|
48 |
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 --> |
|
49 |
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|
50 |
</encoder> |
|
51 |
<!--日志文件最大的大小 --> |
|
52 |
<triggeringPolicy |
|
53 |
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
|
54 |
<MaxFileSize>10MB</MaxFileSize> |
|
55 |
</triggeringPolicy> |
|
56 |
</appender> |
|
57 |
|
|
58 |
<appender name="errorAppender" |
|
59 |
class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|
60 |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|
61 |
<FileNamePattern>${LOG_HOME}/autoForm-error.log.%d{yyyy-MM-dd}.log |
|
62 |
</FileNamePattern> |
|
63 |
</rollingPolicy> |
|
64 |
<encoder> |
|
65 |
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|
66 |
</encoder> |
|
67 |
<filter class="ch.qos.logback.classic.filter.LevelFilter"><!-- 只打印错误日志 --> |
|
68 |
<level>ERROR</level> |
|
69 |
<onMatch>ACCEPT</onMatch> |
|
70 |
<onMismatch>DENY</onMismatch> |
|
71 |
</filter> |
|
72 |
<!--日志文件最大的大小 --> |
|
73 |
<triggeringPolicy |
|
74 |
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
|
75 |
<MaxFileSize>10MB</MaxFileSize> |
|
76 |
</triggeringPolicy> |
|
77 |
</appender> |
|
78 |
|
|
79 |
<logger name="com.apache.ibatis" level="error" additivity="false"> |
|
80 |
<appender-ref ref="STDOUT" /> |
|
81 |
<appender-ref ref="errorAppender" /> |
|
82 |
</logger> |
|
83 |
|
|
84 |
<logger name="java.sql" level="error" additivity="false"> |
|
85 |
<appender-ref ref="STDOUT" /> |
|
86 |
<appender-ref ref="errorAppender" /> |
|
87 |
</logger> |
|
88 |
|
|
89 |
<logger name="org.springframework" level="error" additivity="false"> |
|
90 |
<appender-ref ref="STDOUT" /> |
|
91 |
<appender-ref ref="errorAppender" /> |
|
92 |
</logger> |
|
93 |
|
|
94 |
<logger name="org.apache.http" level="DEBUG" additivity="false"> |
|
95 |
<appender-ref ref="STDOUT" /> |
|
96 |
<appender-ref ref="errorAppender" /> |
|
97 |
</logger> |
|
98 |
|
|
99 |
<logger name="cn.autoform" level="DEBUG"> |
|
100 |
<appender-ref ref="STDOUT" /> |
|
101 |
<appender-ref ref="FILESQL" /> |
|
102 |
<appender-ref ref="errorAppender" /> |
|
103 |
</logger> |
|
104 |
|
|
105 |
<logger name="com.iemsoft.framework" level="DEBUG"> |
|
106 |
<appender-ref ref="STDOUT" /> |
|
107 |
<appender-ref ref="FILESQL" /> |
|
108 |
<appender-ref ref="errorAppender" /> |
|
109 |
</logger> |
|
110 |
|
|
111 |
<!-- 日志输出级别 --> |
|
112 |
<root level="INFO"> |
|
113 |
<appender-ref ref="STDOUT" /> |
|
114 |
<appender-ref ref="FILE" /> |
|
115 |
<appender-ref ref="errorAppender" /> |
|
116 |
</root> |
|
117 |
|
|
118 |
</configuration> |