This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
log4j2.xml
214 lines (192 loc) · 12.5 KB
/
log4j2.xml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?xml version="1.0" encoding="UTF-8" ?>
<Configuration monitorInterval="5" packages="org.apereo.cas.logging">
<Properties>
<!-- The default logs output directory -->
<Property name="tara.log.dir">/var/log/cas</Property>
<!-- Log record format: -->
<Property name="tara.log.pattern">{"date":"%d{yyyy-MM-dd'T'HH:mm:ss,SSSZ}", "level":"%level"%notEmpty{, "requestId":"%X{requestId}"}%notEmpty{, "sessionId":"%X{sessionId}"}, "logger":"%logger", "thread":"%thread", "message":"%enc{%msg}{JSON}"}%n</Property>
<!-- Log record format: error details -->
<Property name="tara.error_details_log.pattern">{"date":"%d{yyyy-MM-dd'T'HH:mm:ss,SSSZ}", "level":"%level"%notEmpty{, "requestId":"%X{requestId}"}%notEmpty{, "sessionId":"%X{sessionId}"}, "throwable":"%enc{%throwable}{JSON}"}%n</Property>
<!-- Log record format: cas_audit.log -->
<Property name="tara.audit_log.pattern">{"request":"%enc{%X{method} %X{scheme}://%X{serverName}:%X{serverPort}%X{requestUri}}{JSON}", "requestId":"%X{requestId}", "sessionId":"%X{sessionId}", "message":"%enc{%msg}{JSON}"}%n</Property>
<!-- Log record format: stats.log -->
<Property name="tara.stats_log.pattern">%enc{%.-1000msg}{JSON}%n</Property>
<!-- Log record format for syslog. Note that the syslog facility code is constant: 'local1' (17). And syslog priority is assigned error (3) in case of ERROR level, otherwise 'notice' (5) shall be used) -->
<Property name="tara.syslog.pattern"><%level{WARN=141, DEBUG=141, ERROR=139, TRACE=141, INFO=141}>1 %d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} ${hostName} rak-tara.log - - - ${sys:tara.log.pattern}</Property>
<!-- Log record format for syslog. Note that the syslog facility code is constant: 'local1' (17). And syslog priority is assigned error (3) in case of ERROR level, otherwise 'notice' (5) shall be used) -->
<Property name="tara.audit.syslog.pattern"><%level{WARN=141, DEBUG=141, ERROR=139, TRACE=141, INFO=141}>1 %d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} ${hostName} rak-tara_audit.log - - - ${sys:tara.audit_log.pattern}</Property>
<!-- Log record format for syslog. Note that the syslog facility code is constant: 'local1' (17). And syslog priority is assigned error (3) in case of ERROR level, otherwise 'notice' (5) shall be used) -->
<Property name="tara.stats.syslog.pattern"><%level{WARN=141, DEBUG=141, ERROR=139, TRACE=141, INFO=141}>1 %d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} ${hostName} rak-tara_stats.log - - - ${sys:tara.stats_log.pattern}</Property>
<!-- The default log verbosity level for cas.log -->
<Property name="tara.log.level">info</Property>
<!-- The default log verbosity level for console -->
<Property name="tara.console.level">off</Property>
</Properties>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d %-5level %X{requestId}/%X{sessionId} %logger{1.} [%thread] --- <%enc{%m}>%throwable%n}"/>
</Console>
<!-- NB! Uncomment and configure this section when using sending log events to tara-stat service; -->
<!--Syslog name="taraStatServiceAppender"
host="tara-stat-rakendus.ci.kit" port="5001" protocol="TCP"
charset="UTF-8" facility="AUTH" newLine="true" >
<SSL>
<KeyStore location="/path/to/log4j2-keystore.jks" password="changeit"/>
<TrustStore location="/path/to/log4j2-truststore.jks" password="changeit"/>
</SSL>
</Syslog-->
<!-- NB! Uncomment and configure this section when sending log events to external syslog server -->
<!--Socket name="taraSyslog" host="example_host" port="example_port" protocol="SSL">
<PatternLayout charset="UTF-8" pattern="${sys:tara.syslog.pattern}" alwaysWriteExceptions="false"/>
<SSL>
<KeyStore location="/path/to/log4j2-keystore.jks" password="changeit"/>
<TrustStore location="/path/to/log4j2-truststore.jks" password="changeit"/>
</SSL>
</Socket>
<Socket name="taraAuditSyslog" host="example_host" port="example_port" protocol="SSL">
<PatternLayout charset="UTF-8" pattern="${sys:tara.audit.syslog.pattern}" alwaysWriteExceptions="false"/>
<SSL>
<KeyStore location="/path/to/log4j2-keystore.jks" password="changeit"/>
<TrustStore location="/path/to/log4j2-truststore.jks" password="changeit"/>
</SSL>
</Socket>
<Socket name="taraStatsSyslog" host="example_host" port="example_port" protocol="SSL">
<PatternLayout charset="UTF-8" pattern="${sys:tara.stats.syslog.pattern}" alwaysWriteExceptions="false"/>
<SSL>
<KeyStore location="/path/to/log4j2-keystore.jks" password="changeit"/>
<TrustStore location="/path/to/log4j2-truststore.jks" password="changeit"/>
</SSL>
</Socket-->
<RollingFile name="statisticsFileAppender" append="true"
filePattern="${sys:tara.log.dir}/stats-%d{yyyy-MM-dd}.log">
<PatternLayout pattern="${sys:tara.stats_log.pattern}"/>
<CronTriggeringPolicy schedule="0 0 * * * ?"/> <!-- Log rotation once the date/time pattern no longer applies to the active file. This policy accepts an interval attribute which indicates how frequently the rollover should occur based on the time pattern and a modulate boolean attribute. -->
<DirectWriteRolloverStrategy>
<Delete basePath="${sys:tara.log.dir}">
<IfFileName glob="stats-*.log" />
<IfLastModified age="7d" />
</Delete>
</DirectWriteRolloverStrategy>
</RollingFile>
<RollingFile name="file" append="true"
filePattern="${sys:tara.log.dir}/cas-%d{yyyy-MM-dd}.log">
<PatternLayout alwaysWriteExceptions="false" pattern="${sys:tara.log.pattern}" />
<CronTriggeringPolicy schedule="0 0 * * * ?"/>
<DirectWriteRolloverStrategy>
<Delete basePath="${sys:tara.log.dir}">
<IfFileName glob="cas-*.log" />
<IfLastModified age="7d" />
</Delete>
</DirectWriteRolloverStrategy>
</RollingFile>
<RollingFile name="errorFile" append="true"
filePattern="${sys:tara.log.dir}/cas_error-%d{yyyy-MM-dd}.log">
<PatternLayout alwaysWriteExceptions="false" pattern="${sys:tara.error_details_log.pattern}" />
<CronTriggeringPolicy schedule="0 0 * * * ?"/>
<DirectWriteRolloverStrategy>
<Delete basePath="${sys:tara.log.dir}">
<IfFileName glob="cas_error-*.log" />
<IfLastModified age="7d" />
</Delete>
</DirectWriteRolloverStrategy>
</RollingFile>
<RollingFile name="auditlogfile" append="true"
filePattern="${sys:tara.log.dir}/cas_audit-%d{yyyy-MM-dd}.log">
<PatternLayout pattern="${sys:tara.audit_log.pattern}"/>
<CronTriggeringPolicy schedule="0 0 * * * ?"/>
<DirectWriteRolloverStrategy>
<Delete basePath="${sys:tara.log.dir}">
<IfFileName glob="cas_audit-*.log" />
<IfLastModified age="7d" />
</Delete>
</DirectWriteRolloverStrategy>
</RollingFile>
<!-- Files older than 1 day are deleted. -->
<RollingFile name="perfFileAppender" append="true"
filePattern="${sys:tara.log.dir}/perfStats-%d{yyyy-MM-dd}.log">
<PatternLayout pattern="%m%n"/>
<CronTriggeringPolicy schedule="0 0 * * * ?"/>
<DirectWriteRolloverStrategy>
<Delete basePath="${sys:tara.log.dir}">
<IfFileName glob="perfStats-*.log" />
<IfLastModified age="1d" />
</Delete>
</DirectWriteRolloverStrategy>
</RollingFile>
<CasAppender name="casAudit">
<AppenderRef ref="auditlogfile" />
</CasAppender>
<CasAppender name="casFile">
<AppenderRef ref="file" />
</CasAppender>
<CasAppender name="casConsole">
<AppenderRef ref="console" />
</CasAppender>
<CasAppender name="casPerf">
<AppenderRef ref="perfFileAppender" />
</CasAppender>
</Appenders>
<Loggers>
<AsyncLogger name="nz.net.ultraq.thymeleaf" level="error" additivity="false" >
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="errorFile" level="error" />
<AppenderRef ref="casFile" level="${sys:tara.log.level}" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraSyslog" level="${sys:tara.log.level}" /-->
</AsyncLogger>
<AsyncLogger name="org.pac4j" level="info" additivity="false" >
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="errorFile" level="error" />
<AppenderRef ref="casFile" level="info" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraSyslog" level="${sys:tara.log.level}" /-->
</AsyncLogger>
<AsyncLogger name="org.apereo.cas" level="warn" additivity="false" >
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="errorFile" level="error" />
<AppenderRef ref="casFile" level="${sys:tara.log.level}" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraSyslog" level="${sys:tara.log.level}" /-->
</AsyncLogger>
<AsyncLogger name="ee.ria" level="${sys:tara.log.level}" additivity="false" >
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="errorFile" level="error" />
<AppenderRef ref="casFile" level="${sys:tara.log.level}" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraSyslog" level="${sys:tara.log.level}" /-->
</AsyncLogger>
<AsyncLogger name="auditLog" level="info" includeLocation="true" additivity="false">
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="casAudit"/>
<AppenderRef ref="errorFile" level="error" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraAuditSyslog" level="${sys:tara.log.level}" /-->
</AsyncLogger>
<AsyncLogger name="ee.ria.sso.statistics.StatisticsHandler" level="debug" additivity="false">
<AppenderRef ref="statisticsFileAppender"/>
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraStatsSyslog"/-->
</AsyncLogger>
<AsyncLogger name="perfStatsLogger" level="info" includeLocation="true" additivity="false">
<AppenderRef ref="casPerf"/>
</AsyncLogger>
<AsyncLogger name="ee.ria.sso.statistics.TaraStatHandler" level="info" additivity="false">
<!-- Uncomment when using Tara-Stat service -->
<!--AppenderRef ref="taraStatServiceAppender"/-->
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
</AsyncLogger>
<AsyncLogger name="ee.sk.mid.rest.MidLoggingFilter" level="trace" additivity="false">
<AppenderRef ref="casFile" />
</AsyncLogger>
<AsyncLogger name="ee.sk.smartid.rest.LoggingFilter" level="trace" additivity="false">
<AppenderRef ref="casFile" />
</AsyncLogger>
<AsyncRoot level="warn">
<AppenderRef ref="casConsole" level="${sys:tara.console.level}" />
<AppenderRef ref="casFile" level="${sys:tara.log.level}" />
<AppenderRef ref="errorFile" level="error" />
<!-- Uncomment when using syslog appender -->
<!--AppenderRef ref="taraSyslog" level="${sys:tara.log.level}" /-->
</AsyncRoot>
</Loggers>
</Configuration>