/
logback.xml
251 lines (223 loc) · 9.55 KB
/
logback.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<configuration>
<!-- dCache logs to a hierarchy of log targets or loggers. The root
of this hierarchy is called root. All other loggers have a name
that is typically the class name of the component logging. Most
of the time the specific name of a logger is not important, as
one typically only adjusts the log level of the root
logger. Unless specifically redefined, the log level is
inherited from the parent logger and ultimately from the root
logger.
Appenders are output components that write log messages
somewhere. In dCache, log files are generated by redirecting
standard out to the log file. Hence there is a ConsoleAppender
for logging to stdout. Another appender directs log messages to
the cell pinboard. The pinboard is accessible through the
dCache admin shell.
Please consult the logback manual for information about other
appenders. There exist appenders for writing directly to log
files, remote logging, logging through syslog, and to generate
emails.
Appenders are attached to loggers at specific points in the
logger hierarchy, typically the root.
In logback classic the log level is adjusted directly for a
logger. This proves insufficient for dCache. Therefore we
instantiate a CellThresholdFilter. This filter allows the log
level to be defined for a logger per appender and per
cell. Thus rather than adjusting the log level of a logger
globally, one adjusts it for a specific appender and a specific
cell. The filter can be readjusted for each cell at runtime
through the dCache admin shell.
Besides the inheritance in the logger hiearchy, log level
definitions are inherited between cells: If a cell creates
another cell, then the log level definitions of the parent cell
are inherited. This is relevant for doors that create a cell
instance per connection: The log level can be adjusted for the
master door cell and the cells created per connection will
inherit the log levels from the master cell. The root of this
inheritance hirarchy is defined in the filter definition below
as threshold-tags. Each tag defines a log level for a
particular logger. The definition can be limited to a
particular appender or apply to all appenders.
Given a particular appender, the algorithm for determining the
effective log level for a logger l and a cell c is:
1. If a log level for l and c is defined then that is the effective
log level.
2. Otherwise use the log level for l in the lowest ancestor of c
for which the log level is defined.
3. If there is no such lowest ancestor for c, then use the
effective log level for c of the parent logger.
Don't worry too much about the specific algorithm. You do not
need to understand it in details to adjust log levels at
runtime through the dCache admin shell.
-->
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${dcache.log.format.file}</pattern>
</encoder>
</appender>
<appender name="pinboard" class="dmg.util.PinboardAppender">
<layout>
<pattern>${dcache.log.format.pinboard}</pattern>
</layout>
</appender>
<appender name="events" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${dcache.log.dir}/${dcache.domain.name}.events</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${dcache.log.dir}/${dcache.domain.name}.events.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>0</maxHistory>
</rollingPolicy>
<encoder>
<!-- Implements event based logging following the NetLogger format.
The log format was originally documented as a CEDPS best practice recommendation,
however CEDPS no longer exists. A more current description of the format can
be found at https://docs.google.com/document/d/1oeW_l_YgQbR-C_7R2cKl6eYBT5N4WSMbvz0AT6hYDvA
The NetLogger project can be found at http://netlogger.lbl.gov -->
<pattern>%m%n</pattern>
</encoder>
</appender>
<appender name="access" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${dcache.log.dir}/${dcache.domain.name}.access</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${dcache.log.dir}/${dcache.domain.name}.access.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>${dcache.log.access.max-history}</maxHistory>
</rollingPolicy>
<encoder>
<!-- Access log for doors. Currently only supported by SRM. Follows
the NetLogger format as described above.
-->
<pattern>%m%n</pattern>
</encoder>
</appender>
<!-- The conditional is to avoid an infinite retry of a non-existent connection
by the socket appender if an alarms service is not running, which,
for example, is the case when remote logging is left off system-wide. -->
<if condition='!"${dcache.log.level.remote}".equals("off")'>
<then>
<appender name="socket" class="ch.qos.logback.classic.net.SocketAppender">
<!-- Regardless of the level to which the remote appender is set,
only messages marked as ALARM are allowed through -->
<filter class="org.dcache.alarms.logback.AlarmFilter"/>
<remoteHost>${dcache.log.server.host}</remoteHost>
<port>${dcache.log.server.port}</port>
<reconnectionDelay>10000</reconnectionDelay>
</appender>
<appender name="remote" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="socket" />
</appender>
</then>
</if>
<root>
<appender-ref ref="stdout"/>
<appender-ref ref="pinboard"/>
<if condition='!"${dcache.log.level.remote}".equals("off")'>
<then>
<appender-ref ref="remote"/>
</then>
</if>
</root>
<logger name="org.dcache.events" additivity="false">
<appender-ref ref="events"/>
</logger>
<logger name="org.dcache.access" additivity="false">
<appender-ref ref="access"/>
</logger>
<!-- Nothing is logged to this logger. Its sole purpose is to list
all appenders available; this ensures that the appenders are
available in the dCache admin interface. -->
<logger name="dummy" level="OFF">
<appender-ref ref="stdout"/>
<appender-ref ref="pinboard"/>
<appender-ref ref="events"/>
<appender-ref ref="access"/>
<if condition='!"${dcache.log.level.remote}".equals("off")'>
<then>
<appender-ref ref="remote"/>
</then>
</if>
</logger>
<turboFilter class="dmg.util.logback.CellThresholdFilter">
<!-- Important: This turboFilter must be instantiated after
appenders and loggers have been instantiated. -->
<onHigherOrEqual>ACCEPT</onHigherOrEqual>
<onLower>DENY</onLower>
<threshold>
<logger>root</logger>
<level>off</level>
</threshold>
<threshold>
<logger>COM.claymoresystems.ptls.SSLDebug</logger>
<level>off</level>
</threshold>
<threshold>
<logger>org.glite.security.trustmanager.CRLFileTrustManager</logger>
<level>error</level>
</threshold>
<threshold>
<logger>org.glite.security.trustmanager.ContextWrapper</logger>
<level>off</level>
</threshold>
<threshold>
<logger>org.glite.security.trustmanager.axis.AXISSocketFactory</logger>
<level>off</level>
</threshold>
<threshold>
<logger>org.glite.security.util.DirectoryList</logger>
<level>off</level>
</threshold>
<threshold>
<!-- Logs all Netty I/O. Very noisy. -->
<logger>io.netty.handler.logging.LoggingHandler</logger>
<level>off</level>
</threshold>
<threshold>
<!-- With v3.4, ZK logs a stacktrace when the client
disconnects unexpectedly. This is fixed with v3.5 and
later. See
https://issues.apache.org/jira/browse/ZOOKEEPER-2809 -->
<logger>org.apache.zookeeper.server.NIOServerCnxn</logger>
<level>error</level>
</threshold>
<threshold>
<!-- ZK currently contains a race-condition that triggers a
CancelledKeyException on shutdown; if triggered, a
stack-trace is logged at WARN level. See
https://issues.apache.org/jira/browse/ZOOKEEPER-2838
Adjusting log-level as a work-around. -->
<logger>org.apache.zookeeper.server.NIOServerCnxnFactory</logger>
<level>error</level>
</threshold>
<threshold>
<logger>liquibase</logger>
<level>warn</level>
</threshold>
<threshold>
<appender>stdout</appender>
<logger>root</logger>
<level>${dcache.log.level.file}</level>
</threshold>
<if condition='!"${dcache.log.level.remote}".equals("off")'>
<then>
<threshold>
<appender>remote</appender>
<logger>root</logger>
<level>${dcache.log.level.remote}</level>
</threshold>
</then>
</if>
<threshold>
<appender>pinboard</appender>
<logger>root</logger>
<level>${dcache.log.level.pinboard}</level>
</threshold>
<threshold>
<appender>events</appender>
<logger>org.dcache.events</logger>
<level>${dcache.log.level.events}</level>
</threshold>
<threshold>
<appender>access</appender>
<logger>org.dcache.access</logger>
<level>${dcache.log.level.access}</level>
</threshold>
</turboFilter>
</configuration>