1dea673e9SRodney W. Grimes.\" Copyright (c) 1990, 1991, 1993 2dea673e9SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 3dea673e9SRodney W. Grimes.\" 4dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 5dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions 6dea673e9SRodney W. Grimes.\" are met: 7dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 8dea673e9SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 9dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 10dea673e9SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 11dea673e9SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12dea673e9SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software 13dea673e9SRodney W. Grimes.\" must display the following acknowledgement: 14dea673e9SRodney W. Grimes.\" This product includes software developed by the University of 15dea673e9SRodney W. Grimes.\" California, Berkeley and its contributors. 16dea673e9SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors 17dea673e9SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 18dea673e9SRodney W. Grimes.\" without specific prior written permission. 19dea673e9SRodney W. Grimes.\" 20dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23dea673e9SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30dea673e9SRodney W. Grimes.\" SUCH DAMAGE. 31dea673e9SRodney W. Grimes.\" 32dea673e9SRodney W. Grimes.\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 33dea673e9SRodney W. Grimes.\" 34dea673e9SRodney W. Grimes.Dd June 9, 1993 35dea673e9SRodney W. Grimes.Dt SYSLOG.CONF 5 36dea673e9SRodney W. Grimes.Os 37dea673e9SRodney W. Grimes.Sh NAME 38dea673e9SRodney W. Grimes.Nm syslog.conf 39dea673e9SRodney W. Grimes.Nd 40dea673e9SRodney W. Grimes.Xr syslogd 8 41dea673e9SRodney W. Grimesconfiguration file 42dea673e9SRodney W. Grimes.Sh DESCRIPTION 43dea673e9SRodney W. GrimesThe 44dea673e9SRodney W. Grimes.Nm syslog.conf 45dea673e9SRodney W. Grimesfile is the configuration file for the 46dea673e9SRodney W. Grimes.Xr syslogd 8 47dea673e9SRodney W. Grimesprogram. 48f8c034f9SJordan K. HubbardIt consists of 49f8c034f9SJordan K. Hubbardblocks of lines separated by 50f8c034f9SJordan K. Hubbard.Em program 51f8c034f9SJordan K. Hubbardspecifications, 52f8c034f9SJordan K. Hubbardwith each line containing two fields: the 53dea673e9SRodney W. Grimes.Em selector 54dea673e9SRodney W. Grimesfield which specifies the types of messages and priorities to which the 55dea673e9SRodney W. Grimesline applies, and an 56dea673e9SRodney W. Grimes.Em action 57dea673e9SRodney W. Grimesfield which specifies the action to be taken if a message 58dea673e9SRodney W. Grimes.Xr syslogd 59dea673e9SRodney W. Grimesreceives matches the selection criteria. 60dea673e9SRodney W. GrimesThe 61dea673e9SRodney W. Grimes.Em selector 62dea673e9SRodney W. Grimesfield is separated from the 63dea673e9SRodney W. Grimes.Em action 64dea673e9SRodney W. Grimesfield by one or more tab characters. 65dea673e9SRodney W. Grimes.Pp 66dea673e9SRodney W. GrimesThe 67dea673e9SRodney W. Grimes.Em Selectors 68dea673e9SRodney W. Grimesfunction 69dea673e9SRodney W. Grimesare encoded as a 70dea673e9SRodney W. Grimes.Em facility , 71dea673e9SRodney W. Grimesa period (``.''), and a 72dea673e9SRodney W. Grimes.Em level , 73dea673e9SRodney W. Grimeswith no intervening white-space. 74dea673e9SRodney W. GrimesBoth the 75dea673e9SRodney W. Grimes.Em facility 76dea673e9SRodney W. Grimesand the 77dea673e9SRodney W. Grimes.Em level 78dea673e9SRodney W. Grimesare case insensitive. 79dea673e9SRodney W. Grimes.Pp 80dea673e9SRodney W. GrimesThe 81dea673e9SRodney W. Grimes.Em facility 82dea673e9SRodney W. Grimesdescribes the part of the system generating the message, and is one of 83dea673e9SRodney W. Grimesthe following keywords: auth, authpriv, cron, daemon, kern, lpr, mail, 84dea673e9SRodney W. Grimesmark, news, syslog, user, uucp and local0 through local7. 85dea673e9SRodney W. GrimesThese keywords (with the exception of mark) correspond to the 86dea673e9SRodney W. Grimessimilar 87dea673e9SRodney W. Grimes.Dq Dv LOG_ 88dea673e9SRodney W. Grimesvalues specified to the 89dea673e9SRodney W. Grimes.Xr openlog 3 90dea673e9SRodney W. Grimesand 91dea673e9SRodney W. Grimes.Xr syslog 3 92dea673e9SRodney W. Grimeslibrary routines. 93dea673e9SRodney W. Grimes.Pp 94dea673e9SRodney W. GrimesThe 95dea673e9SRodney W. Grimes.Em level 96dea673e9SRodney W. Grimesdescribes the severity of the message, and is a keyword from the 97dea673e9SRodney W. Grimesfollowing ordered list (higher to lower): emerg, alert, crit, err, 983d08ec92SPaul Trainawarning, notice, info and debug. 99dea673e9SRodney W. GrimesThese keywords correspond to the 100dea673e9SRodney W. Grimessimilar 101dea673e9SRodney W. Grimes.Pq Dv LOG_ 102dea673e9SRodney W. Grimesvalues specified to the 103dea673e9SRodney W. Grimes.Xr syslog 104dea673e9SRodney W. Grimeslibrary routine. 105dea673e9SRodney W. Grimes.Pp 106f8c034f9SJordan K. HubbardEach block of lines is separated from the previous block by a tag. The tag 107f8c034f9SJordan K. Hubbardis a line beginning with 108f8c034f9SJordan K. Hubbard.Em #!prog 109f8c034f9SJordan K. Hubbardor 110f8c034f9SJordan K. Hubbard.Em !prog 111f8c034f9SJordan K. Hubbard(the former is for compatibility with the previous syslogd, if one is sharing 112f8c034f9SJordan K. Hubbardsyslog.conf files, for example) 113f8c034f9SJordan K. Hubbardand each block will be associated with calls to syslog from that specific 114f8c034f9SJordan K. Hubbardprogram. 115f8c034f9SJordan K. Hubbard.Pp 116dea673e9SRodney W. GrimesSee 117dea673e9SRodney W. Grimes.Xr syslog 3 118dea673e9SRodney W. Grimesfor a further descriptions of both the 119dea673e9SRodney W. Grimes.Em facility 120dea673e9SRodney W. Grimesand 121dea673e9SRodney W. Grimes.Em level 122f8c034f9SJordan K. Hubbardkeywords and their significance. It's preferred that selections be made on 123f8c034f9SJordan K. Hubbard.Em facility 124f8c034f9SJordan K. Hubbardrather than 125f8c034f9SJordan K. Hubbard.Em program , 126f8c034f9SJordan K. Hubbardsince the latter can easily vary in a networked environment. In some cases, 127f8c034f9SJordan K. Hubbardthough, an appropriate 128f8c034f9SJordan K. Hubbard.Em facility 129f8c034f9SJordan K. Hubbardsimply doesn't exist (for example, 130f8c034f9SJordan K. Hubbard.Em ftpd 131f8c034f9SJordan K. Hubbardlogs under LOG_DAEMON along with a myriad other programs). 132dea673e9SRodney W. Grimes.Pp 133dea673e9SRodney W. GrimesIf a received message matches the specified 134dea673e9SRodney W. Grimes.Em facility 135dea673e9SRodney W. Grimesand is of the specified 136dea673e9SRodney W. Grimes.Em level 137dea673e9SRodney W. Grimes.Em (or a higher level) , 138f8c034f9SJordan K. Hubbardand the first word in the message after the date matches the 139f8c034f9SJordan K. Hubbard.Em program , 140dea673e9SRodney W. Grimesthe action specified in the 141dea673e9SRodney W. Grimes.Em action 142dea673e9SRodney W. Grimesfield will be taken. 143dea673e9SRodney W. Grimes.Pp 144dea673e9SRodney W. GrimesMultiple 145dea673e9SRodney W. Grimes.Em selectors 146dea673e9SRodney W. Grimesmay be specified for a single 147dea673e9SRodney W. Grimes.Em action 148dea673e9SRodney W. Grimesby separating them with semicolon (``;'') characters. 149dea673e9SRodney W. GrimesIt is important to note, however, that each 150dea673e9SRodney W. Grimes.Em selector 151dea673e9SRodney W. Grimescan modify the ones preceding it. 152dea673e9SRodney W. Grimes.Pp 153dea673e9SRodney W. GrimesMultiple 154dea673e9SRodney W. Grimes.Em facilities 155dea673e9SRodney W. Grimesmay be specified for a single 156dea673e9SRodney W. Grimes.Em level 157dea673e9SRodney W. Grimesby separating them with comma (``,'') characters. 158dea673e9SRodney W. Grimes.Pp 159dea673e9SRodney W. GrimesAn asterisk (``*'') can be used to specify all 160dea673e9SRodney W. Grimes.Em facilities 161f8c034f9SJordan K. Hubbardall 162f8c034f9SJordan K. Hubbard.Em levels 163dea673e9SRodney W. Grimesor all 164f8c034f9SJordan K. Hubbard.Em programs . 165dea673e9SRodney W. Grimes.Pp 166dea673e9SRodney W. GrimesThe special 167dea673e9SRodney W. Grimes.Em facility 168dea673e9SRodney W. Grimes``mark'' receives a message at priority ``info'' every 20 minutes 169dea673e9SRodney W. Grimes(see 170dea673e9SRodney W. Grimes.Xr syslogd 8 ) . 171dea673e9SRodney W. GrimesThis is not enabled by a 172dea673e9SRodney W. Grimes.Em facility 173dea673e9SRodney W. Grimesfield containing an asterisk. 174dea673e9SRodney W. Grimes.Pp 175dea673e9SRodney W. GrimesThe special 176dea673e9SRodney W. Grimes.Em level 177dea673e9SRodney W. Grimes``none'' disables a particular 178dea673e9SRodney W. Grimes.Em facility . 179dea673e9SRodney W. Grimes.Pp 180dea673e9SRodney W. GrimesThe 181dea673e9SRodney W. Grimes.Em action 182dea673e9SRodney W. Grimesfield of each line specifies the action to be taken when the 183dea673e9SRodney W. Grimes.Em selector 184dea673e9SRodney W. Grimesfield selects a message. 1855fadfc4cSJoerg WunschThere are five forms: 186dea673e9SRodney W. Grimes.Bl -bullet 187dea673e9SRodney W. Grimes.It 188dea673e9SRodney W. GrimesA pathname (beginning with a leading slash). 189dea673e9SRodney W. GrimesSelected messages are appended to the file. 190dea673e9SRodney W. Grimes.It 191dea673e9SRodney W. GrimesA hostname (preceded by an at (``@'') sign). 192dea673e9SRodney W. GrimesSelected messages are forwarded to the 193dea673e9SRodney W. Grimes.Xr syslogd 194dea673e9SRodney W. Grimesprogram on the named host. 195dea673e9SRodney W. Grimes.It 196dea673e9SRodney W. GrimesA comma separated list of users. 197dea673e9SRodney W. GrimesSelected messages are written to those users 198dea673e9SRodney W. Grimesif they are logged in. 199dea673e9SRodney W. Grimes.It 200dea673e9SRodney W. GrimesAn asterisk. 201dea673e9SRodney W. GrimesSelected messages are written to all logged-in users. 2025fadfc4cSJoerg Wunsch.It 2035fadfc4cSJoerg WunschA vertical bar (``|''), followed by a command to pipe the selected 2045fadfc4cSJoerg Wunschmessages to. The command is passed to a 2055fadfc4cSJoerg Wunsch.Pa /bin/sh 2065fadfc4cSJoerg Wunschfor evaluation, so usual shell metacharacters or input/output 2075fadfc4cSJoerg Wunschredirection can occur. (Note however that redirecting 2085fadfc4cSJoerg Wunsch.Xr stdio 3 2095fadfc4cSJoerg Wunschbuffered output from the invoked command can cause additional delays, 2105fadfc4cSJoerg Wunschor even lost output data in case a logging subprocess exited with a 2115fadfc4cSJoerg Wunschsignal.) The command itself runs with 2125fadfc4cSJoerg Wunsch.Em stdout 2135fadfc4cSJoerg Wunschand 2145fadfc4cSJoerg Wunsch.Em stderr 2155fadfc4cSJoerg Wunschredirected to 2165fadfc4cSJoerg Wunsch.Pa /dev/null . 2175fadfc4cSJoerg WunschUpon receipt of a 2185fadfc4cSJoerg Wunsch.Dv SIGHUP , 2195fadfc4cSJoerg Wunsch.Nm syslogd 2205fadfc4cSJoerg Wunschwill close the pipe to the process. If the process didn't exit 2217fa793ccSMike Pritchardvoluntarily, it will be sent a 2225fadfc4cSJoerg Wunsch.Dv SIGTERM 2235fadfc4cSJoerg Wunschsignal after a grace period of up to 40 seconds. 2245fadfc4cSJoerg Wunsch.Pp 2257fa793ccSMike PritchardThe command will only be started once data arrives that should be piped 2265fadfc4cSJoerg Wunschto it. If it exited later, it will be restarted as necessary. 2275fadfc4cSJoerg Wunsch.Pp 2285fadfc4cSJoerg WunschUnless the command is a full pipeline, it's probably useful to 2295fadfc4cSJoerg Wunschstart the command with 2305fadfc4cSJoerg Wunsch.Em exec 2315fadfc4cSJoerg Wunschso that the invoking shell process does not wait for the command to 2327fa793ccSMike Pritchardcomplete. Warning: the process is started under the UID invoking 2335fadfc4cSJoerg Wunsch.Xr syslogd 8 , 2347fa793ccSMike Pritchardnormally the superuser. 235dea673e9SRodney W. Grimes.El 236dea673e9SRodney W. Grimes.Pp 237dea673e9SRodney W. GrimesBlank lines and lines whose first non-blank character is a hash (``#'') 238dea673e9SRodney W. Grimescharacter are ignored. 239dea673e9SRodney W. Grimes.Sh EXAMPLES 240dea673e9SRodney W. Grimes.Pp 241dea673e9SRodney W. GrimesA configuration file might appear as follows: 242dea673e9SRodney W. Grimes.Bd -literal 243dea673e9SRodney W. Grimes# Log all kernel messages, authentication messages of 244dea673e9SRodney W. Grimes# level notice or higher and anything of level err or 245dea673e9SRodney W. Grimes# higher to the console. 246dea673e9SRodney W. Grimes# Don't log private authentication messages! 247dea673e9SRodney W. Grimes*.err;kern.*;auth.notice;authpriv.none /dev/console 248dea673e9SRodney W. Grimes 249dea673e9SRodney W. Grimes# Log anything (except mail) of level info or higher. 250dea673e9SRodney W. Grimes# Don't log private authentication messages! 251dea673e9SRodney W. Grimes*.info;mail.none;authpriv.none /var/log/messages 252dea673e9SRodney W. Grimes 253dea673e9SRodney W. Grimes# The authpriv file has restricted access. 254dea673e9SRodney W. Grimesauthpriv.* /var/log/secure 255dea673e9SRodney W. Grimes 256dea673e9SRodney W. Grimes# Log all the mail messages in one place. 257dea673e9SRodney W. Grimesmail.* /var/log/maillog 258dea673e9SRodney W. Grimes 259dea673e9SRodney W. Grimes# Everybody gets emergency messages, plus log them on another 260dea673e9SRodney W. Grimes# machine. 261dea673e9SRodney W. Grimes*.emerg * 262dea673e9SRodney W. Grimes*.emerg @arpa.berkeley.edu 263dea673e9SRodney W. Grimes 264dea673e9SRodney W. Grimes# Root and Eric get alert and higher messages. 265dea673e9SRodney W. Grimes*.alert root,eric 266dea673e9SRodney W. Grimes 267dea673e9SRodney W. Grimes# Save mail and news errors of level err and higher in a 268dea673e9SRodney W. Grimes# special file. 269dea673e9SRodney W. Grimesuucp,news.crit /var/log/spoolerr 270f8c034f9SJordan K. Hubbard 2715fadfc4cSJoerg Wunsch# Pipe all authentication messages to a filter. 2725fadfc4cSJoerg Wunschauth.* |exec /usr/local/sbin/authfilter 2735fadfc4cSJoerg Wunsch 274f8c034f9SJordan K. Hubbard# Save ftpd transactions along with mail and news 275f8c034f9SJordan K. Hubbard!ftpd 276f8c034f9SJordan K. Hubbard*.* /var/log/spoolerr 277dea673e9SRodney W. Grimes.Ed 278dea673e9SRodney W. Grimes.Sh FILES 279dea673e9SRodney W. Grimes.Bl -tag -width /etc/syslog.conf -compact 280dea673e9SRodney W. Grimes.It Pa /etc/syslog.conf 281dea673e9SRodney W. GrimesThe 282dea673e9SRodney W. Grimes.Xr syslogd 8 283dea673e9SRodney W. Grimesconfiguration file. 284dea673e9SRodney W. Grimes.El 285dea673e9SRodney W. Grimes.Sh BUGS 286dea673e9SRodney W. GrimesThe effects of multiple selectors are sometimes not intuitive. 287dea673e9SRodney W. GrimesFor example ``mail.crit,*.err'' will select ``mail'' facility messages at 288dea673e9SRodney W. Grimesthe level of ``err'' or higher, not at the level of ``crit'' or higher. 289dea673e9SRodney W. Grimes.Sh SEE ALSO 290dea673e9SRodney W. Grimes.Xr syslog 3 , 291dea673e9SRodney W. Grimes.Xr syslogd 8 292