-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlog4j2.yml
102 lines (93 loc) · 2.48 KB
/
log4j2.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Configuration:
name: SampleLoggingConfig
status: INFO
Properties:
Property:
- name: logs_path
value: "${env:CATALINA_HOME}/logs"
- name: archive
value: "${logs_path}/archive"
- name: file_pattern_layout
value: "%d{yyyy-MMM-dd HH:mm:ss.SSS} %-5level [%t] %c{10} - %msg%n"
Appenders:
Console:
name: CONSOLE
target: SYSTEM_OUT
PatternLayout:
pattern: "%highlight{%d{MMM dd, yyyy HH:mm:ss} %-5level [%t] %c{1.}: %msg%n}"
RollingFile:
- name: INFO_FILE
fileName: ${logs_path}/info-logs.log
filePattern: ${archive}/info-logs-%i.log.gz
immediateFlush: false
PatternLayout:
pattern: ${file_pattern_layout}
Filters:
ThresholdFilter:
- level: WARN
onMatch: "DENY"
onMismatch: "NEUTRAL"
- level: INFO
onMatch: "ACCEPT"
onMismatch: "DENY"
Policies:
SizeBasedTriggeringPolicy:
size: 250MB
DefaultRolloverStrategy:
max: 4
- name: ERROR_FILE
fileName: ${logs_path}/error-logs.log
filePattern: ${archive}/error-logs-%i.log.gz
immediateFlush: true
createOnDemand: true # create file when errors occur
PatternLayout:
pattern: ${file_pattern_layout}
Policies:
SizeBasedTriggeringPolicy:
size: 100MB
DefaultRolloverStrategy:
max: 10
Loggers:
Root:
level: DEBUG
AppenderRef:
- ref: CONSOLE
- ref: INFO_FILE
level: INFO
- ref: ERROR_FILE
level: ERROR
Logger:
- name: com.programmingskillz
additivity: false
level: DEBUG
AppenderRef:
- ref: CONSOLE
- ref: INFO_FILE
level: INFO
- ref: ERROR_FILE
level: ERROR
- name: org.flywaydb
additivity: false
level: INFO
AppenderRef:
- ref: CONSOLE
- ref: INFO_FILE
- ref: ERROR_FILE
level: ERROR
- name: io.swagger
additivity: false
level: INFO
AppenderRef:
- ref: CONSOLE
- ref: INFO_FILE
- ref: ERROR_FILE
level: ERROR
- name: org.reflections
additivity: false
level: ERROR
AppenderRef:
- ref: CONSOLE
- ref: INFO_FILE
level: INFO
- ref: ERROR_FILE
level: ERROR