Commit | Line | Data |
---|---|---|
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 | |
15 | configuration file | |
16 | .Sh DESCRIPTION | |
17 | The | |
18 | .Nm syslog.conf | |
19 | file is the configuration file for the | |
20 | .Xr syslogd 8 | |
ba466e0a KB |
21 | program. |
22 | It consists of lines with two fields: the | |
90190a02 | 23 | .Em selector |
ba466e0a KB |
24 | field which specifies the types of messages and priorities to which the |
25 | line applies, and an | |
90190a02 | 26 | .Em action |
ba466e0a | 27 | field which specifies the action to be taken if a message |
90190a02 | 28 | .Xr syslogd |
ba466e0a KB |
29 | receives matches the selection criteria. |
30 | The | |
90190a02 | 31 | .Em selector |
ba466e0a | 32 | field is separated from the |
90190a02 | 33 | .Em action |
ba466e0a | 34 | field by one or more tab characters. |
90190a02 CL |
35 | .Pp |
36 | The | |
37 | .Em Selectors | |
38 | function | |
ba466e0a | 39 | are encoded as a |
90190a02 | 40 | .Em facility , |
ba466e0a | 41 | a period (``.''), and a |
90190a02 | 42 | .Em level , |
ba466e0a KB |
43 | with no intervening white-space. |
44 | Both the | |
90190a02 | 45 | .Em facility |
ba466e0a | 46 | and the |
90190a02 | 47 | .Em level |
ba466e0a | 48 | are case insensitive. |
90190a02 | 49 | .Pp |
ba466e0a | 50 | The |
90190a02 | 51 | .Em facility |
ba466e0a KB |
52 | describes the part of the system generating the message, and is one of |
53 | the following keywords: auth, authpriv, cron, daemon, kern, lpr, mail, | |
54 | mark, news, syslog, user, uucp and local0 through local7. | |
55 | These keywords (with the exception of mark) correspond to the | |
90190a02 CL |
56 | similar |
57 | .Dq Dv LOG_ | |
58 | values specified to the | |
59 | .Xr openlog 3 | |
ba466e0a | 60 | and |
90190a02 | 61 | .Xr syslog 3 |
ba466e0a | 62 | library routines. |
90190a02 | 63 | .Pp |
ba466e0a | 64 | The |
90190a02 | 65 | .Em level |
ba466e0a KB |
66 | describes the severity of the message, and is a keyword from the |
67 | following ordered list (higher to lower): emerg, alert, crit, err, | |
68 | warning, notice and debug. | |
69 | These keywords correspond to the | |
90190a02 CL |
70 | similar |
71 | .Pq Dv LOG_ | |
72 | values specified to the | |
73 | .Xr syslog | |
ba466e0a | 74 | library routine. |
90190a02 | 75 | .Pp |
ba466e0a | 76 | See |
90190a02 | 77 | .Xr syslog 3 |
ba466e0a | 78 | for a further descriptions of both the |
90190a02 | 79 | .Em facility |
ba466e0a | 80 | and |
90190a02 | 81 | .Em level |
ba466e0a | 82 | keywords and their significance. |
90190a02 | 83 | .Pp |
ba466e0a | 84 | If a received message matches the specified |
90190a02 | 85 | .Em facility |
ba466e0a | 86 | and is of the specified |
90190a02 CL |
87 | .Em level |
88 | .Em (or a higher level) , | |
ba466e0a | 89 | the action specified in the |
90190a02 | 90 | .Em action |
ba466e0a | 91 | field will be taken. |
90190a02 | 92 | .Pp |
ba466e0a | 93 | Multiple |
90190a02 | 94 | .Em selectors |
ba466e0a | 95 | may be specified for a single |
90190a02 | 96 | .Em action |
ba466e0a | 97 | by separating them with semicolon (``;'') characters. |
4558968a | 98 | It is important to note, however, that each |
90190a02 | 99 | .Em selector |
4558968a | 100 | can modify the ones preceding it. |
90190a02 | 101 | .Pp |
ba466e0a | 102 | Multiple |
90190a02 | 103 | .Em facilities |
ba466e0a | 104 | may be specified for a single |
90190a02 | 105 | .Em level |
ba466e0a | 106 | by separating them with comma (``,'') characters. |
90190a02 | 107 | .Pp |
ba466e0a | 108 | An asterisk (``*'') can be used to specify all |
90190a02 | 109 | .Em facilities |
ba466e0a | 110 | or all |
90190a02 CL |
111 | .Em levels . |
112 | .Pp | |
ba466e0a | 113 | The 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 | 118 | This is not enabled by a |
90190a02 | 119 | .Em facility |
ba466e0a | 120 | field containing an asterisk. |
90190a02 | 121 | .Pp |
ba466e0a | 122 | The special |
90190a02 | 123 | .Em level |
ba466e0a | 124 | ``none'' disables a particular |
90190a02 CL |
125 | .Em facility . |
126 | .Pp | |
ba466e0a | 127 | The |
90190a02 | 128 | .Em action |
ba466e0a | 129 | field of each line specifies the action to be taken when the |
90190a02 | 130 | .Em selector |
ba466e0a KB |
131 | field selects a message. |
132 | There are four forms: | |
90190a02 CL |
133 | .Bl -bullet |
134 | .It | |
ba466e0a KB |
135 | A pathname (beginning with a leading slash). |
136 | Selected messages are appended to the file. | |
90190a02 | 137 | .It |
ba466e0a KB |
138 | A hostname (preceded by an at (``@'') sign). |
139 | Selected messages are forwarded to the | |
90190a02 | 140 | .Xr syslogd |
ba466e0a | 141 | program on the named host. |
90190a02 | 142 | .It |
ba466e0a KB |
143 | A comma separated list of users. |
144 | Selected messages are written to those users | |
145 | if they are logged in. | |
90190a02 | 146 | .It |
ba466e0a KB |
147 | An asterisk. |
148 | Selected messages are written to all logged-in users. | |
90190a02 CL |
149 | .El |
150 | .Pp | |
ba466e0a KB |
151 | Blank lines and lines whose first non-blank character is a hash (``#'') |
152 | character are ignored. | |
90190a02 CL |
153 | .Sh EXAMPLES |
154 | .Pp | |
ba466e0a | 155 | A 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. | |
168 | authpriv.* /var/log/secure | |
169 | ||
170 | # Log all the mail messages in one place. | |
171 | mail.* /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. | |
183 | uucp,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 | |
188 | The | |
189 | .Xr syslogd 8 | |
190 | configuration file. | |
191 | .El | |
192 | .Sh BUGS | |
4558968a KB |
193 | The effects of multiple selectors are sometimes not intuitive. |
194 | For example ``mail.crit,*.err'' will select ``mail'' facility messages at | |
195 | the 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 |