-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathlog4j.properties
54 lines (45 loc) · 2.16 KB
/
log4j.properties
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
log4j.rootLogger=DEBUG,CONSOLE,A1,R,FILE1,FILE2,FILE3
log4j.addivity.org.apache=true
# 应用于控制台
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
# 每天新建日志
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=./log/log4j.log
log4j.appender.A1.Threshold=DEBUG
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}\:%L \: %m%n
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
#每天输出一个日志文件
log4j.appender.R.DatePattern='_'yyyy-MM-dd'.log'
#昨天的日志文件名Sendmsg+“昨天日期”.log
log4j.appender.R.File=C\:/log4j/debusssssg.log
#日志文件的路径,${catalina.home} 即Tomcat下
log4j.appender.R.layout=org.apache.log4j.HTMLLayout
#日志文件输出格式
log4j.appender.R.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#应用于文件 (调试文件)
log4j.appender.FILE1=org.apache.log4j.FileAppender
log4j.appender.FILE1.File=C\:/log4j/debug.log
log4j.appender.FILE1.Threshold=DEBUG
log4j.appender.FILE1.Append=true
log4j.appender.FILE1.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE1.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#应用于文件 (INFO文件)
log4j.appender.FILE2=org.apache.log4j.FileAppender
log4j.appender.FILE2.File=C\:/log4j/INFO.log
log4j.appender.FILE2.Threshold=INFO
log4j.appender.FILE2.Append=true
log4j.appender.FILE2.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE2.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#应用于文件 (错误文件)
log4j.appender.FILE3=org.apache.log4j.FileAppender
log4j.appender.FILE3.File=C\:/log4j/error.log
log4j.appender.FILE3.Threshold=ERROR
log4j.appender.FILE3.Append=false
log4j.appender.FILE3.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE3.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n