forgot to describe effects of multiple selectors
[unix-history] / usr / src / usr.sbin / syslogd / syslog.conf.5
CommitLineData
ba466e0a
KB
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
4558968a 6.\" @(#)syslog.conf.5 5.2 (Berkeley) %G%
ba466e0a
KB
7.\"
8.TH SYSLOG.CONF 5 ""
9.UC 7
10.SH NAME
11syslog.conf \- syslogd configuration file
12.SH DESCRIPTION
13.I Syslog.conf
14is the configuration file for the
15.IR syslogd (8)
16program.
17It consists of lines with two fields: the
18.I selector
19field which specifies the types of messages and priorities to which the
20line applies, and an
21.I action
22field which specifies the action to be taken if a message
23.IR syslogd
24receives matches the selection criteria.
25The
26.I selector
27field is separated from the
28.I action
29field by one or more tab characters.
30.PP
31.I Selectors
32are encoded as a
33.IR facility ,
34a period (``.''), and a
35.IR level ,
36with no intervening white-space.
37Both the
38.I facility
39and the
40.I level
41are case insensitive.
42.PP
43The
44.I facility
45describes the part of the system generating the message, and is one of
46the following keywords: auth, authpriv, cron, daemon, kern, lpr, mail,
47mark, news, syslog, user, uucp and local0 through local7.
48These keywords (with the exception of mark) correspond to the
49similar ``LOG_'' values specified to the
50.I openlog
51and
52.I syslog
53library routines.
54.PP
55The
56.I level
57describes the severity of the message, and is a keyword from the
58following ordered list (higher to lower): emerg, alert, crit, err,
59warning, notice and debug.
60These keywords correspond to the
61similar ``LOG_'' values specified to the
62.I syslog
63library routine.
64.PP
65See
66.IR syslog (3)
67for a further descriptions of both the
68.I facility
69and
70.I level
71keywords and their significance.
72.PP
73If a received message matches the specified
74.I facility
75and is of the specified
76.I level
77.BR "(or a higher level)" ,
78the action specified in the
79.I action
80field will be taken.
81.PP
82Multiple
83.I selectors
84may be specified for a single
85.I action
86by separating them with semicolon (``;'') characters.
4558968a
KB
87It is important to note, however, that each
88.I selector
89can modify the ones preceding it.
ba466e0a
KB
90.PP
91Multiple
92.I facilities
93may be specified for a single
94.I level
95by separating them with comma (``,'') characters.
96.PP
97An asterisk (``*'') can be used to specify all
98.I facilities
99or all
100.IR levels .
101.PP
102The special
103.I facility
104``mark'' receives a message at priority ``info'' every 20 minutes
105(see
106.IR syslogd (8)).
107This is not enabled by a
108.I facility
109field containing an asterisk.
110.PP
111The special
112.I level
113``none'' disables a particular
114.IR facility .
115.PP
116The
117.I action
118field of each line specifies the action to be taken when the
119.I selector
120field selects a message.
121There are four forms:
122.IP \(bu 3n
123A pathname (beginning with a leading slash).
124Selected messages are appended to the file.
125.IP \(bu 3n
126A hostname (preceded by an at (``@'') sign).
127Selected messages are forwarded to the
128.I syslogd
129program on the named host.
130.IP \(bu 3n
131A comma separated list of users.
132Selected messages are written to those users
133if they are logged in.
134.IP \(bu 3n
135An asterisk.
136Selected messages are written to all logged-in users.
137.PP
138Blank lines and lines whose first non-blank character is a hash (``#'')
139character are ignored.
140.SH EXAMPLES
141.PP
142A configuration file might appear as follows:
143.sp
144.nf
145# Log all kernel messages, authentication messages of
146# level notice or higher and anything of level err or
147# higher to the console.
148# Don't log private authentication messages!
149*.err;kern.*;auth.notice;authpriv.none /dev/console
150
151# Log anything (except mail) of level info or higher.
152# Don't log private authentication messages!
153*.info;mail.none;authpriv.none /var/log/messages
154
155# The authpriv file has restricted access.
156authpriv.* /var/log/secure
157
158# Log all the mail messages in one place.
159mail.* /var/log/maillog
160
161# Everybody gets emergency messages, plus log them on another
162# machine.
163*.emerg *
164*.emerg @arpa.berkeley.edu
165
166# Root and Eric get alert and higher messages.
167*.alert root,eric
168
169# Save mail and news errors of level err and higher in a
170# special file.
171uucp,news.crit /var/log/spoolerr
172.fi
173.SH FILES
174/etc/syslog.conf \fIsyslogd\fP(8) configuration file
4558968a
KB
175.SH BUGS
176The effects of multiple selectors are sometimes not intuitive.
177For example ``mail.crit,*.err'' will select ``mail'' facility messages at
178the level of ``err'' or higher, not at the level of ``crit'' or higher.
ba466e0a
KB
179.SH "SEE ALSO"
180syslog(3), syslogd(8)