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