aboutsummaryrefslogblamecommitdiffstats
path: root/doc/src/configuration.xml
blob: eddd098373cdb66db7d383ad5da54ef33194d553 (plain) (tree)
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
















































































































































































































































































































































































































































































































































































                                                                                                                                                                                     
<section>
	<title>Syslog client</title>
	<para>
The configuration file for client is optional.
Its name is <filename>syslog.host</filename> and it should contain host
name or IPv4 address optionally followed by the colon and the port number.
By default port is 514.
If the file is missing then localhost is assumed.
	</para>
	<para>
This may look a bit ugly but if you have a better idea, send me a patch.
But keep in mind that client should not have any dependencies like daemon.
	</para>
</section>

<section>
	<title>Syslog daemon</title>
	<para>
The concept is quite simple: there are message <emphasis>sources</emphasis>,
message <emphasis>filters</emphasis> and <emphasis>destinations</emphasis>.
Each item has its unique (among other items of the same kind) name.
The <emphasis>logpath</emphasis> ties together source, filter and destination.
	</para>
	<para>
Only one of the items of each kind may be specified in logpath.
But several logpaths may refer to the same source, filter or destination.
	</para>
	<para>
The configuration file for daemon has XML format.
It is not so convinient as its counterpart for any UNIX syslog.
Following the windows way I plan to implement GUI configuration tool.
So its content is not intended to be convinient for human.
	</para>
	<para>
The root element should be <emphasis>conf</emphasis>.
It is not checked by the parser however.
Top-level elements and their attributes are described below.
	</para>

	<section>
		<title>
&lt;source/&gt;
		</title>
		<para>
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
name
					</term>
					<listitem>
						<para>
Required.
The name of message source.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
type
					</term>
					<listitem>
						<para>
Required.
There are two source types: <emphasis>internal</emphasis>
and <emphasis>udp</emphasis>.
<emphasis>Internal</emphasis> type corresponds to syslog daemon itself
and <emphasis>udp</emphasis> defines a listening UDP socket.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
interface
					</term>
					<listitem>
						<para>
Optional.
If the source type is <emphasis>udp</emphasis>, it defines interface
the socket will be bound to.
Default is 0.0.0.0.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
port
					</term>
					<listitem>
						<para>
Optional.
If source type is <emphasis>udp</emphasis> it defines listening port number.
Default is 514.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
	</section>

	<section>
		<title>
&lt;destination/&gt;
		</title>
		<para>
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
name
					</term>
					<listitem>
						<para>
Required.
The name of the destination.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
file
					</term>
					<listitem>
						<para>
Required.
The pattern for the file name.
It may contain the following format characters:
<segmentedlist>
	<?dbhtml list-presentation="table"?>
	<segtitle>Format</segtitle><segtitle>Description</segtitle>
	<seglistitem><seg>%Y</seg><seg>four-digit year</seg></seglistitem>
	<seglistitem><seg>%M</seg><seg>two-digit month, 01...12</seg></seglistitem>
	<seglistitem><seg>%m</seg><seg>month, 1...12</seg></seglistitem>
	<seglistitem><seg>%D</seg><seg>two-digit day of month, 01...31</seg></seglistitem>
	<seglistitem><seg>%d</seg><seg>day of month, 1...31</seg></seglistitem>
	<seglistitem><seg>%W</seg><seg>day of week, 1...7, 1 for sunday</seg></seglistitem>
	<seglistitem><seg>%F</seg><seg>facility name</seg></seglistitem>
	<seglistitem><seg>%f</seg><seg>facility in numeric form</seg></seglistitem>
	<seglistitem><seg>%L</seg><seg>priority level name</seg></seglistitem>
	<seglistitem><seg>%l</seg><seg>priority level in numeric form</seg></seglistitem>
	<seglistitem><seg>%H</seg><seg>source host name (a <quote>device</quote>, according to <ulink url="http://www.ietf.org/rfc/rfc3164.txt">RFC 3164</ulink>)</seg></seglistitem>
	<seglistitem><seg>%h</seg><seg>sender host name (datagram sender, which may be device or relay)</seg></seglistitem>
	<seglistitem><seg>%P</seg><seg>program name</seg></seglistitem>
	<seglistitem><seg>%%</seg><seg>% character</seg></seglistitem>
</segmentedlist>
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
rotate
					</term>
					<listitem>
						<para>
Optional.
Rotate log files periodically.
Possible values are:
<emphasis>daily</emphasis>,
<emphasis>weekly</emphasis>,
<emphasis>monthly</emphasis>.
						</para>
						<para>
Note that if rotation is turned on then it is strongly recommended
not to use format characters in the filename pattern.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
size
					</term>
					<listitem>
						<para>
Optional.
Log files are rotated when they grow bigger then <emphasis>size</emphasis> bytes.
If size is followed by M, the size if assumed to be in megabytes.
If the k is used, the size is in kilobytes.
So size 100, size 100k, and size 100M are all valid.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
backlogs
					</term>
					<listitem>
						<para>
Optional.
If rotation is turned on this attribute specifies the number of backlog files.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
ifempty
					</term>
					<listitem>
						<para>
Optional.
Rotate the log file even if it is empty.
Possible values are: <emphasis>yes</emphasis>, <emphasis>no</emphasis>.
Default is <emphasis>yes</emphasis>.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
olddir
					</term>
					<listitem>
						<para>
Optional.
Logs are moved to this directory for rotation.
If value is a relative path then this directory will be located in the same
directory with syslogd executable.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
compresscmd
					</term>
					<listitem>
						<para>
Optional.
Command to use to compress log file.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
compressoptions
					</term>
					<listitem>
						<para>
Optional.
Command line options may be passed to the compression program, if one is in use.
Options may contain $PATHNAME and $FILENAME substrings which will be replaced
with backlog pathname and basename respectively.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
	</section>

	<section>
		<title>
&lt;filter/&gt;
		</title>
		<para>
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
name
					</term>
					<listitem>
						<para>
Required.
The name of the filter.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
		<para>
This element may contain sub-elements <emphasis>facility</emphasis>
and <emphasis>priority</emphasis>.
		</para>
		<section>
			<title>
	&lt;facility/&gt;
			</title>
			<para>
				<variablelist>
					<title>
Attributes
					</title>
					<varlistentry>
						<term>
name
						</term>
						<listitem>
							<para>
Facility name. May be one of the following:
<simplelist type="vert" columns="1">
	<member>kern</member>
	<member>user</member>
	<member>mail</member>
	<member>daemon</member>
	<member>auth</member>
	<member>syslog</member>
	<member>lpr</member>
	<member>news</member>
	<member>uucp</member>
	<member>cron</member>
	<member>authpriv</member>
	<member>ftp</member>
	<member>local0</member>
	<member>local1</member>
	<member>local2</member>
	<member>local3</member>
	<member>local4</member>
	<member>local5</member>
	<member>local6</member>
	<member>local7</member>
</simplelist>
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term>
value
						</term>
						<listitem>
							<para>
Alternatively, the facility may be given in the numeric form.
Possible range is 0...23.
							</para>
						</listitem>
					</varlistentry>
				</variablelist>
			</para>
		</section>
		<section>
			<title>
	&lt;priority/&gt;
			</title>
			<para>
				<variablelist>
					<title>
						Attributes
					</title>
					<varlistentry>
						<term>
							name
						</term>
						<listitem>
							<para>
Priority name. May be one of the following:
<simplelist type="vert" columns="1">
	<member>emerg</member>
	<member>alert</member>
	<member>crit</member>
	<member>error</member>
	<member>warning</member>
	<member>notice</member>
	<member>info</member>
	<member>debug</member>
</simplelist>
							</para>
						</listitem>
					</varlistentry>
					<varlistentry>
						<term>
value
						</term>
						<listitem>
							<para>
Alternatively, the priority may be given in the numeric form.
Possible range is 0...7.
							</para>
						</listitem>
					</varlistentry>
				</variablelist>
			</para>
		</section>
	</section>
	
	<section>
		<title>
&lt;logpath/&gt;
		</title>
		<para>
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
source
					</term>
					<listitem>
						<para>
Required.
The name of the source.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
filter
					</term>
					<listitem>
						<para>
Optional.
The name of the filter.
					</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
destination
					</term>
					<listitem>
						<para>
Required.
The name of the destination.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
	</section>

	<section>
		<title>
&lt;purge/&gt;
		</title>
		<para>
When destination file name contains format characters, this option is quite useful.
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
directory
					</term>
					<listitem>
						<para>
Required.
Directory to purge.
Must be a relative path inside <emphasis>logdir</emphasis>
(see configuration options below).
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
keep_days
					</term>
					<listitem>
						<para>
Required.
How long to keep files.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
	</section>

	<section>
		<title>
&lt;options/&gt;
		</title>
		<para>
			<variablelist>
				<title>
Attributes
				</title>
				<varlistentry>
					<term>
logdir
					</term>
					<listitem>
						<para>
Required.
Drectory for the log files.
If value is a relative path then this directory will be located in the same
directory with syslogd executable.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
dns
					</term>
					<listitem>
						<para>
Optional.
Use resolver to determine sender host name.
Possible values are: <emphasis>yes</emphasis>, <emphasis>no</emphasis>.
Default is <emphasis>yes</emphasis>.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
source_encoding
					</term>
					<listitem>
						<para>
Optional.
Convert incoming messages from specified encoding to
<emphasis>destination_encoding</emphasis>.
Default is do not convert.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
destination_encoding
					</term>
					<listitem>
						<para>
Required, if <emphasis>source_encoding</emphasis> is given.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
mark_interval
					</term>
					<listitem>
						<para>
Optional.
Interval in second between emissions of mark message.
Zero means do not emit mark messages and this is the
default value.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
mark_message
					</term>
					<listitem>
						<para>
Optional.
The content of mark message.
Default is <quote>-- MARK --</quote>.
						</para>
					</listitem>
				</varlistentry>
				<varlistentry>
					<term>
hold
					</term>
					<listitem>
						<para>
Optional.
Number of seconds to hold a single message in queue.
During this time identical messages are coalesced.
Minimum is 1, default is 3 seconds.
						</para>
					</listitem>
				</varlistentry>
			</variablelist>
		</para>
	</section>

</section>