]>
Commit | Line | Data |
---|---|---|
6dbe3af9 KZ |
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
2 | .\" 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 5.3 (Berkeley) 5/10/91 | |
33 | .\" | |
34 | .Dd May 10, 1991 | |
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 | |
726f69e2 KZ |
55 | received matches the selection criteria. There may not be |
56 | .Em any | |
57 | spaces in the action field. | |
6dbe3af9 KZ |
58 | The |
59 | .Em selector | |
60 | field is separated from the | |
61 | .Em action | |
726f69e2 KZ |
62 | field by one or more tab or space characters (this is a departure from the |
63 | standard BSD way of doing things: both tabs | |
64 | .Em and | |
65 | spaces may be used to separate the selector from the action). | |
6dbe3af9 KZ |
66 | .Pp |
67 | The | |
68 | .Em Selector | |
69 | functions | |
70 | are encoded as a | |
71 | .Em facility , | |
72 | a period (``.''), and a | |
73 | .Em level , | |
74 | with no intervening white-space. | |
75 | Both the | |
76 | .Em facility | |
77 | and the | |
78 | .Em level | |
79 | are case insensitive. | |
80 | .Pp | |
81 | The | |
82 | .Em facility | |
83 | describes the part of the system generating the message, and is one of | |
84 | the following keywords: auth, authpriv, cron, daemon, kern, lpr, mail, | |
85 | mark, news, syslog, user, uucp and local0 through local7. | |
86 | These keywords (with the exception of mark) correspond to the | |
87 | similar | |
88 | .Dq Dv LOG_ | |
89 | values specified to the | |
90 | .Xr openlog 3 | |
91 | and | |
92 | .Xr syslog 3 | |
93 | library routines. | |
94 | .Pp | |
95 | The | |
96 | .Em level | |
97 | describes the severity of the message, and is a keyword, optionally | |
98 | preceded by an equals (``=''), from the following ordered list | |
99 | (higher to lower): emerg, alert, crit, err, warning, notice, info, | |
100 | and debug. | |
101 | These keywords correspond to the | |
102 | similar | |
103 | .Pq Dv LOG_ | |
104 | values specified to the | |
105 | .Xr syslog | |
106 | library routine. | |
107 | .Pp | |
108 | See | |
109 | .Xr syslog 3 | |
110 | for a further descriptions of both the | |
111 | .Em facility | |
112 | and | |
113 | .Em level | |
114 | keywords and their significance. | |
115 | .Pp | |
116 | If a received message matches the specified | |
117 | .Em facility | |
118 | and is of the specified | |
119 | .Em level | |
120 | .Em (or a higher level if | |
121 | .Em level | |
122 | was specified without ``='') , | |
123 | the action specified in the | |
124 | .Em action | |
125 | field will be taken. | |
126 | .Pp | |
127 | Multiple | |
128 | .Em selectors | |
129 | may be specified for a single | |
130 | .Em action | |
131 | by separating them with semicolon (``;'') characters. | |
132 | It is important to note, however, that each | |
133 | .Em selector | |
134 | can modify the ones preceding it. | |
135 | .Pp | |
136 | Multiple | |
137 | .Em facilities | |
138 | may be specified for a single | |
139 | .Em level | |
140 | by separating them with comma (``,'') characters. | |
141 | .Pp | |
142 | An asterisk (``*'') can be used to specify all | |
143 | .Em facilities | |
144 | or all | |
145 | .Em levels . | |
146 | .Pp | |
147 | The special | |
148 | .Em facility | |
149 | ``mark'' receives a message at priority ``info'' every 20 minutes | |
150 | (see | |
151 | .Xr syslogd 8 ) . | |
152 | This is not enabled by a | |
153 | .Em facility | |
154 | field containing an asterisk. | |
155 | .Pp | |
156 | The special | |
157 | .Em level | |
158 | ``none'' disables a particular | |
159 | .Em facility . | |
160 | .Pp | |
161 | The | |
162 | .Em action | |
163 | field of each line specifies the action to be taken when the | |
164 | .Em selector | |
165 | field selects a message. | |
166 | There are four forms: | |
167 | .Bl -bullet | |
168 | .It | |
169 | A pathname (beginning with a leading slash). | |
170 | Selected messages are appended to the file. | |
171 | .It | |
172 | A hostname (preceded by an at (``@'') sign). | |
173 | Selected messages are forwarded to the | |
174 | .Xr syslogd | |
175 | program on the named host. | |
176 | .It | |
177 | A comma separated list of users. | |
178 | Selected messages are written to those users | |
179 | if they are logged in. | |
180 | .It | |
181 | An asterisk. | |
182 | Selected messages are written to all logged-in users. | |
183 | .El | |
184 | .Pp | |
185 | Blank lines and lines whose first non-blank character is a hash (``#'') | |
186 | character are ignored. | |
187 | .Sh EXAMPLES | |
188 | .Pp | |
189 | A 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 | # Log debug messages only | |
202 | *.=debug /var/log/debug | |
203 | ||
204 | # The authpriv file has restricted access. | |
205 | authpriv.* /var/log/secure | |
206 | ||
207 | # Log all the mail messages in one place. | |
208 | mail.* /var/log/maillog | |
209 | ||
210 | # Everybody gets emergency messages, plus log them on another | |
211 | # machine. | |
212 | *.emerg * | |
213 | *.emerg @arpa.berkeley.edu | |
214 | ||
215 | # Root and Eric get alert and higher messages. | |
216 | *.alert root,eric | |
217 | ||
218 | # Save mail and news errors of level err and higher in a | |
219 | # special file. | |
220 | uucp,news.crit /var/log/spoolerr | |
221 | .Ed | |
222 | .Sh FILES | |
223 | .Bl -tag -width /etc/syslog.conf -compact | |
224 | .It Pa /etc/syslog.conf | |
225 | The | |
226 | .Xr syslogd 8 | |
227 | configuration file. | |
228 | .El | |
229 | .Sh BUGS | |
230 | The effects of multiple selectors are sometimes not intuitive. | |
231 | For example ``mail.crit,*.err'' will select ``mail'' facility messages at | |
232 | the level of ``err'' or higher, not at the level of ``crit'' or higher. | |
233 | .Sh SEE ALSO | |
234 | .Xr syslog 3 , | |
235 | .Xr syslogd 8 | |
236 | .Sh HISTORY | |
237 | The | |
238 | .Nm syslog.conf | |
239 | file format is | |
240 | .Ud . |