xref: /netbsd/usr.sbin/syslogd/syslog.conf.5 (revision bf9ec67e)
1.\"	$NetBSD: syslog.conf.5,v 1.9 2002/02/02 01:58:52 wiz Exp $
2.\"
3.\" Copyright (c) 1990, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     from: @(#)syslog.conf.5	8.1 (Berkeley) 6/9/93
35.\"
36.Dd June 9, 1993
37.Dt SYSLOG.CONF 5
38.Os
39.Sh NAME
40.Nm syslog.conf
41.Nd
42.Xr syslogd 8
43configuration file
44.Sh DESCRIPTION
45The
46.Nm
47file is the configuration file for the
48.Xr syslogd 8
49program.
50It consists of lines with two fields: the
51.Em selector
52field which specifies the types of messages and priorities to which the
53line applies, and an
54.Em action
55field which specifies the action to be taken if a message
56.Xr syslogd 8
57receives matches the selection criteria.
58The
59.Em selector
60field is separated from the
61.Em action
62field by one or more tab characters.
63.Pp
64The
65.Em Selectors
66function
67are encoded as a
68.Em facility ,
69a period (``.''), and a
70.Em level ,
71with no intervening white-space.
72Both the
73.Em facility
74and the
75.Em level
76are case insensitive.
77.Pp
78The
79.Em facility
80describes the part of the system generating the message, and is one of
81the following keywords: auth, authpriv, cron, ftp, daemon, kern, lpr,
82mail, mark, news, syslog, user, uucp and local0 through local7.
83These keywords (with the exception of mark) correspond to the
84similar
85.Dq Dv LOG_
86values specified to the
87.Xr openlog 3
88and
89.Xr syslog 3
90library routines.
91.Pp
92The
93.Em level
94describes the severity of the message, and is a keyword from the
95following ordered list (higher to lower): emerg, alert, crit, err,
96warning, notice, info and debug.
97These keywords correspond to the
98similar
99.Pq Dv LOG_
100values specified to the
101.Xr syslog 3
102library routine.
103.Pp
104See
105.Xr syslog 3
106for a further descriptions of both the
107.Em facility
108and
109.Em level
110keywords and their significance.
111.Pp
112If a received message matches the specified
113.Em facility
114and is of the specified
115.Em level
116.Em (or a higher level) ,
117the action specified in the
118.Em action
119field will be taken.
120.Pp
121Multiple
122.Em selectors
123may be specified for a single
124.Em action
125by separating them with semicolon (``;'') characters.
126It is important to note, however, that each
127.Em selector
128can modify the ones preceding it.
129.Pp
130Multiple
131.Em facilities
132may be specified for a single
133.Em level
134by separating them with comma (``,'') characters.
135.Pp
136An asterisk (``*'') can be used to specify all
137.Em facilities
138or all
139.Em levels .
140.Pp
141The special
142.Em facility
143``mark'' receives a message at priority ``info'' every 20 minutes
144(see
145.Xr syslogd 8 ) .
146This is not enabled by a
147.Em facility
148field containing an asterisk.
149.Pp
150The special
151.Em level
152``none'' disables a particular
153.Em facility .
154.Pp
155The
156.Em action
157field of each line specifies the action to be taken when the
158.Em selector
159field selects a message.
160There are four forms:
161.Bl -bullet
162.It
163A pathname (beginning with a leading slash).
164Selected messages are appended to the file.
165.It
166A hostname (preceded by an at (``@'') sign).
167Selected messages are forwarded to the
168.Xr syslogd 8
169program on the named host.
170.It
171A comma separated list of users.
172Selected messages are written to those users
173if they are logged in.
174.It
175An asterisk.
176Selected messages are written to all logged-in users.
177.El
178.Pp
179Blank lines and lines whose first non-blank character is a hash (``#'')
180character are ignored.
181.Sh FILES
182.Bl -tag -width /etc/syslog.conf -compact
183.It Pa /etc/syslog.conf
184The
185.Xr syslogd 8
186configuration file.
187.El
188.Sh EXAMPLES
189A configuration file might appear as follows:
190.Bd -literal
191# Log all kernel messages, authentication messages of
192# level notice or higher and anything of level err or
193# higher to the console.
194# Don't log private authentication messages!
195*.err;kern.*;auth.notice;authpriv.none	/dev/console
196
197# Log anything (except mail) of level info or higher.
198# Don't log private authentication messages!
199*.info;mail.none;authpriv.none		/var/log/messages
200
201# The authpriv file has restricted access.
202authpriv.*						/var/log/secure
203
204# Log all the mail messages in one place.
205mail.*							/var/log/maillog
206
207# Everybody gets emergency messages, plus log them on another
208# machine.
209*.emerg							*
210*.emerg							@arpa.berkeley.edu
211
212# Root and Eric get alert and higher messages.
213*.alert							root,eric
214
215# Save mail and news errors of level err and higher in a
216# special file.
217uucp,news.crit						/var/log/spoolerr
218.Ed
219.Sh SEE ALSO
220.Xr syslog 3 ,
221.Xr syslogd 8
222.Sh HISTORY
223The
224.Nm
225file appeared in
226.Bx 4.3 ,
227along with
228.Xr syslogd 8 .
229.Sh BUGS
230The effects of multiple selectors are sometimes not intuitive.
231For example ``mail.crit,*.err'' will select ``mail'' facility messages at
232the level of ``err'' or higher, not at the level of ``crit'' or higher.
233