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