1 .\" Copyright (c) 1990, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93
42 file is the configuration file for the
46 blocks of lines separated by
50 specifications (separations appear alone on their lines),
51 with each line containing two fields: the
53 field which specifies the types of messages and priorities to which the
56 field which specifies the action to be taken if a message
58 receives matches the selection criteria.
61 field is separated from the
63 field by one or more tab characters or spaces.
65 Note that if you use spaces as separators, your
67 might be incompatible with other Unices or Unix-like systems.
68 This functionality was added for ease of configuration
69 (e.g.\& it is possible to cut-and-paste into
71 and to avoid possible mistakes.
72 This change however preserves
73 backwards compatibility with the old style of
75 (i.e., tab characters only).
83 an optional set of comparison flags
84 .Pq Oo \&! Oc Op <=> ,
87 with no intervening white-space.
96 describes the part of the system generating the message, and is one of
97 the following keywords: auth, authpriv, console, cron, daemon, ftp, kern,
98 lpr, mail, mark, news, ntp, security, syslog, user, uucp and local0 through
100 These keywords (with the exception of mark) correspond to
103 values specified to the
111 may be used to specify exactly what is logged.
112 The default comparison is
116 which means that messages from the specified
118 list, and of a priority
119 level equal to or greater than
122 Comparison flags beginning with
124 will have their logical sense inverted.
127 means all levels except info and
129 has the same meaning as
134 describes the severity of the message, and is a keyword from the
135 following ordered list (higher to lower): emerg, alert, crit, err,
136 warning, notice, info and debug.
137 These keywords correspond to
140 values specified to the
144 Each block of lines is separated from the previous block by a
149 A block will only log messages corresponding to the most recent
153 specifications given.
154 Thus, with a block which selects
158 directly followed by a block that selects messages from the
161 the second block will only log messages
168 specification is a line beginning with
172 (the former is for compatibility with the previous syslogd, if one is sharing
175 and the following blocks will be associated with calls to
177 from that specific program.
182 will also match any message logged by the kernel with the prefix
188 specification works just like the previous one,
193 specification will match any message but the ones from that
195 Multiple programs may be listed, separated by commas:
197 matches messages from either program, while
199 matches all messages but those from
206 specification of the form
210 means the following blocks will be applied to messages
211 received from the specified hostname.
218 causes the following blocks to be applied to messages
219 from any host but the one specified.
220 If the hostname is given as
222 the local hostname will be used.
223 As for program specifications, multiple comma-separated
224 values may be specified for hostname specifications.
230 specification may be reset by giving the program or hostname as
235 for further descriptions of both the
239 keywords and their significance.
240 It is preferred that selections be made on
244 since the latter can easily vary in a networked environment.
246 though, an appropriate
248 simply does not exist.
250 If a received message matches the specified
252 and is of the specified
254 .Em (or a higher level) ,
255 and the first word in the message after the date matches the
257 the action specified in the
263 may be specified for a single
265 by separating them with semicolon
268 It is important to note, however, that each
270 can modify the ones preceding it.
274 may be specified for a single
276 by separating them with comma
282 can be used to specify all
292 receives a message at priority
297 This is not enabled by a
299 field containing an asterisk.
304 disables a particular
309 field of each line specifies the action to be taken when the
311 field selects a message.
312 There are five forms:
315 A pathname (beginning with a leading slash).
316 Selected messages are appended to the file.
318 To ensure that kernel messages are written to disk promptly,
322 after writing messages from the kernel.
323 Other messages are not synced explicitly.
324 You may prefix a pathname with the minus sign,
326 to forego syncing the specified file after every kernel message.
327 Note that you might lose information if the system crashes
328 immediately following a write attempt.
329 Nevertheless, using the
331 option may improve performance,
332 especially if the kernel is logging many messages.
334 A hostname (preceded by an at
337 Selected messages are forwarded to the
339 program on the named host.
340 If a port number is added after a colon
342 then that port will be used as the destination port rather than the usual syslog port.
344 A comma separated list of users.
345 Selected messages are written to those users
346 if they are logged in.
349 Selected messages are written to all logged-in users.
353 followed by a command to pipe the selected
355 The command is passed to
357 for evaluation, so usual shell metacharacters or input/output
358 redirection can occur.
359 (Note however that redirecting
361 buffered output from the invoked command can cause additional delays,
362 or even lost output data in case a logging subprocess exited with a
364 The command itself runs with
373 will close the pipe to the process.
374 If the process did not exit
375 voluntarily, it will be sent a
377 signal after a grace period of up to 60 seconds.
379 The command will only be started once data arrives that should be piped
381 If it exited later, it will be restarted as necessary.
383 is desired that the subprocess should get exactly one line of input only
384 (which can be very resource-consuming if there are a lot of messages
385 flowing quickly), this can be achieved by exiting after just one line of
387 If necessary, a script wrapper can be written to this effect.
389 Unless the command is a full pipeline, it is probably useful to
390 start the command with
392 so that the invoking shell process does not wait for the command to
394 Warning: the process is started under the UID invoking
396 normally the superuser.
399 Blank lines and lines whose first non-blank character is a hash
401 character are ignored.
402 .Sh IMPLEMENTATION NOTES
405 facility is usually reserved for messages
406 generated by the local kernel.
407 Other messages logged with facility
409 are usually translated to facility
411 This translation can be disabled;
416 .Bl -tag -width /etc/syslog.conf -compact
417 .It Pa /etc/syslog.conf
422 A configuration file might appear as follows:
424 # Log all kernel messages, authentication messages of
425 # level notice or higher, and anything of level err or
426 # higher to the console.
427 # Don't log private authentication messages!
428 *.err;kern.*;auth.notice;authpriv.none /dev/console
430 # Log anything (except mail) of level info or higher.
431 # Don't log private authentication messages!
432 *.info;mail.none;authpriv.none /var/log/messages
434 # Log daemon messages at debug level only
435 daemon.=debug /var/log/daemon.debug
437 # The authpriv file has restricted access.
438 authpriv.* /var/log/secure
440 # Log all the mail messages in one place.
441 mail.* /var/log/maillog
443 # Everybody gets emergency messages, plus log them on another
446 *.emerg @arpa.berkeley.edu
448 # Root and Eric get alert and higher messages.
451 # Save mail and news errors of level err and higher in a
453 uucp,news.crit /var/log/spoolerr
455 # Pipe all authentication messages to a filter.
456 auth.* |exec /usr/local/sbin/authfilter
458 # Save ftpd transactions along with mail and news
460 *.* /var/log/spoolerr
462 # Log all security messages to a separate file.
463 security.* /var/log/security
465 # Log all writes to /dev/console to a separate file.
466 console.* /var/log/console.log
468 # Log ipfw messages without syncing after every message.
476 The effects of multiple
478 are sometimes not intuitive.
483 facility messages at the level of
485 or higher, not at the level of
489 In networked environments, note that not all operating systems
490 implement the same set of facilities.
492 authpriv, cron, ftp, and ntp that are known to this implementation
493 might be absent on the target system.
494 Even worse, DEC UNIX uses
495 facility number 10 (which is authpriv in this implementation) to
496 log events for their AdvFS file system.