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.\" 4. Neither the name of the University nor the names of its contributors 13dea673e9SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 14dea673e9SRodney W. Grimes.\" without specific prior written permission. 15dea673e9SRodney W. Grimes.\" 16dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19dea673e9SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26dea673e9SRodney W. Grimes.\" SUCH DAMAGE. 27dea673e9SRodney W. Grimes.\" 28dea673e9SRodney W. Grimes.\" @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93 2997d92980SPeter Wemm.\" $FreeBSD$ 30dea673e9SRodney W. Grimes.\" 315b34e708STom Rhodes.Dd December 23, 2008 32dea673e9SRodney W. Grimes.Dt SYSLOG.CONF 5 33dea673e9SRodney W. Grimes.Os 34dea673e9SRodney W. Grimes.Sh NAME 35dea673e9SRodney W. Grimes.Nm syslog.conf 36dea673e9SRodney W. Grimes.Nd 37dea673e9SRodney W. Grimes.Xr syslogd 8 38dea673e9SRodney W. Grimesconfiguration file 39dea673e9SRodney W. Grimes.Sh DESCRIPTION 40dea673e9SRodney W. GrimesThe 4124685462SJohn-Mark Gurney.Nm 42dea673e9SRodney W. Grimesfile is the configuration file for the 43dea673e9SRodney W. Grimes.Xr syslogd 8 44dea673e9SRodney W. Grimesprogram. 45f8c034f9SJordan K. HubbardIt consists of 46f8c034f9SJordan K. Hubbardblocks of lines separated by 47f8c034f9SJordan K. Hubbard.Em program 48a144588dSDavid Maloneand 49a144588dSDavid Malone.Em hostname 50f47dba63SJulian Elischerspecifications (separations appear alone on their lines), 51f8c034f9SJordan K. Hubbardwith each line containing two fields: the 52dea673e9SRodney W. Grimes.Em selector 53dea673e9SRodney W. Grimesfield which specifies the types of messages and priorities to which the 54dea673e9SRodney W. Grimesline applies, and an 55dea673e9SRodney W. Grimes.Em action 56dea673e9SRodney W. Grimesfield which specifies the action to be taken if a message 57922a51eeSPhilippe Charnier.Xr syslogd 8 58dea673e9SRodney W. Grimesreceives matches the selection criteria. 59dea673e9SRodney W. GrimesThe 60dea673e9SRodney W. Grimes.Em selector 61dea673e9SRodney W. Grimesfield is separated from the 62dea673e9SRodney W. Grimes.Em action 6360159a06SJordan K. Hubbardfield by one or more tab characters or spaces. 6460159a06SJordan K. Hubbard.Pp 6560159a06SJordan K. HubbardNote that if you use spaces as separators, your 667ae71655SCrist J. Clark.Nm 6760159a06SJordan K. Hubbardmight be incompatible with other Unices or Unix-like systems. 686b010ec6STom RhodesThis functionality was added for ease of configuration 6907bfccd7SRuslan Ermilov(e.g.\& it is possible to cut-and-paste into 707ae71655SCrist J. Clark.Nm ) , 71f2e366a1SSheldon Hearnand to avoid possible mistakes. 72f2e366a1SSheldon HearnThis change however preserves 736b010ec6STom Rhodesbackwards compatibility with the old style of 747ae71655SCrist J. Clark.Nm 7507bfccd7SRuslan Ermilov(i.e., tab characters only). 76dea673e9SRodney W. Grimes.Pp 77dea673e9SRodney W. GrimesThe 787ae71655SCrist J. Clark.Em selectors 79dea673e9SRodney W. Grimesare encoded as a 80dea673e9SRodney W. Grimes.Em facility , 8124685462SJohn-Mark Gurneya period 8224685462SJohn-Mark Gurney.Pq Dq \&. , 832eec1ab0SPoul-Henning Kampan optional set of comparison flags 84c041c1e0SRuslan Ermilov.Pq Oo \&! Oc Op <=> , 8524685462SJohn-Mark Gurneyand a 86dea673e9SRodney W. Grimes.Em level , 87dea673e9SRodney W. Grimeswith no intervening white-space. 88dea673e9SRodney W. GrimesBoth the 89dea673e9SRodney W. Grimes.Em facility 90dea673e9SRodney W. Grimesand the 91dea673e9SRodney W. Grimes.Em level 92dea673e9SRodney W. Grimesare case insensitive. 93dea673e9SRodney W. Grimes.Pp 94dea673e9SRodney W. GrimesThe 95dea673e9SRodney W. Grimes.Em facility 96dea673e9SRodney W. Grimesdescribes the part of the system generating the message, and is one of 9742c3aae2STom Rhodesthe following keywords: 9842c3aae2STom Rhodes.Cm auth , authpriv , console , cron , daemon , ftp , kern , lpr , 9942c3aae2STom Rhodes.Cm mail , mark , news , ntp , security , syslog , user , uucp , 10042c3aae2STom Rhodesand 10142c3aae2STom Rhodes.Cm local0 10242c3aae2STom Rhodesthrough 10342c3aae2STom Rhodes.Cm local7 . 1046b010ec6STom RhodesThese keywords (with the exception of mark) correspond to 105dea673e9SRodney W. Grimessimilar 106dea673e9SRodney W. Grimes.Dq Dv LOG_ 107dea673e9SRodney W. Grimesvalues specified to the 108dea673e9SRodney W. Grimes.Xr openlog 3 109dea673e9SRodney W. Grimesand 110dea673e9SRodney W. Grimes.Xr syslog 3 111dea673e9SRodney W. Grimeslibrary routines. 112dea673e9SRodney W. Grimes.Pp 113dea673e9SRodney W. GrimesThe 1142eec1ab0SPoul-Henning Kamp.Em comparison flags 1152eec1ab0SPoul-Henning Kampmay be used to specify exactly what is logged. 1166b010ec6STom RhodesThe default comparison is 1172eec1ab0SPoul-Henning Kamp.Dq => 1182eec1ab0SPoul-Henning Kamp(or, if you prefer, 119610a5778SRuslan Ermilov.Dq >= ) , 1202eec1ab0SPoul-Henning Kampwhich means that messages from the specified 1212eec1ab0SPoul-Henning Kamp.Em facility 1226b010ec6STom Rhodeslist, and of a priority 1236b010ec6STom Rhodeslevel equal to or greater than 1242eec1ab0SPoul-Henning Kamp.Em level 1252eec1ab0SPoul-Henning Kampwill be logged. 126ef21d92fSDavid MaloneComparison flags beginning with 127c041c1e0SRuslan Ermilov.Dq Li \&! 128ef21d92fSDavid Malonewill have their logical sense inverted. 129ef21d92fSDavid MaloneThus 130ef21d92fSDavid Malone.Dq !=info 131ef21d92fSDavid Malonemeans all levels except info and 132ef21d92fSDavid Malone.Dq !notice 133ef21d92fSDavid Malonehas the same meaning as 134ef21d92fSDavid Malone.Dq <notice . 1352eec1ab0SPoul-Henning Kamp.Pp 1362eec1ab0SPoul-Henning KampThe 137dea673e9SRodney W. Grimes.Em level 138dea673e9SRodney W. Grimesdescribes the severity of the message, and is a keyword from the 13942c3aae2STom Rhodesfollowing ordered list (higher to lower): 1405b34e708STom Rhodes.Cm emerg , crit , alert , err , warning , notice , info 14142c3aae2STom Rhodesand 14242c3aae2STom Rhodes.Cm debug . 1436b010ec6STom RhodesThese keywords correspond to 144dea673e9SRodney W. Grimessimilar 14524685462SJohn-Mark Gurney.Dq Dv LOG_ 146dea673e9SRodney W. Grimesvalues specified to the 147922a51eeSPhilippe Charnier.Xr syslog 3 148dea673e9SRodney W. Grimeslibrary routine. 149dea673e9SRodney W. Grimes.Pp 150a144588dSDavid MaloneEach block of lines is separated from the previous block by a 151a144588dSDavid Malone.Em program 152f8c034f9SJordan K. Hubbardor 153a144588dSDavid Malone.Em hostname 154a144588dSDavid Malonespecification. 155a144588dSDavid MaloneA block will only log messages corresponding to the most recent 156a144588dSDavid Malone.Em program 157a144588dSDavid Maloneand 158a144588dSDavid Malone.Em hostname 159a144588dSDavid Malonespecifications given. 1606b010ec6STom RhodesThus, with a block which selects 161a144588dSDavid Malone.Ql ppp 162a144588dSDavid Maloneas the 163a144588dSDavid Malone.Em program , 164a144588dSDavid Malonedirectly followed by a block that selects messages from the 165a144588dSDavid Malone.Em hostname 166a144588dSDavid Malone.Ql dialhost , 1676b010ec6STom Rhodesthe second block will only log messages 168a144588dSDavid Malonefrom the 169a144588dSDavid Malone.Xr ppp 8 170a144588dSDavid Maloneprogram on dialhost. 171a144588dSDavid Malone.Pp 172a144588dSDavid MaloneA 173a144588dSDavid Malone.Em program 174a144588dSDavid Malonespecification is a line beginning with 175a144588dSDavid Malone.Ql #!prog 176a144588dSDavid Maloneor 177a144588dSDavid Malone.Ql !prog 178f8c034f9SJordan K. Hubbard(the former is for compatibility with the previous syslogd, if one is sharing 1797ae71655SCrist J. Clark.Nm 180922a51eeSPhilippe Charnierfiles, for example) 181a144588dSDavid Maloneand the following blocks will be associated with calls to 182a144588dSDavid Malone.Xr syslog 3 183a144588dSDavid Malonefrom that specific program. 184a144588dSDavid MaloneA 185a144588dSDavid Malone.Em program 186a144588dSDavid Malonespecification for 187a144588dSDavid Malone.Ql foo 188a144588dSDavid Malonewill also match any message logged by the kernel with the prefix 189a144588dSDavid Malone.Ql "foo: " . 190f50b861cSDaniel C. SobralThe 191f50b861cSDaniel C. Sobral.Ql #!+prog 192f50b861cSDaniel C. Sobralor 193f50b861cSDaniel C. Sobral.Ql !+prog 194f50b861cSDaniel C. Sobralspecification works just like the previous one, 195f50b861cSDaniel C. Sobraland the 196f50b861cSDaniel C. Sobral.Ql #!-prog 197f50b861cSDaniel C. Sobralor 198f50b861cSDaniel C. Sobral.Ql !-prog 199f50b861cSDaniel C. Sobralspecification will match any message but the ones from that 200f50b861cSDaniel C. Sobralprogram. 2017ac1f02eSThomas QuinotMultiple programs may be listed, separated by commas: 2027ac1f02eSThomas Quinot.Ql !prog1,prog2 2037ac1f02eSThomas Quinotmatches messages from either program, while 2047ac1f02eSThomas Quinot.Ql !-prog1,prog2 2057ac1f02eSThomas Quinotmatches all messages but those from 2067ac1f02eSThomas Quinot.Ql prog1 2077ac1f02eSThomas Quinotor 2087ac1f02eSThomas Quinot.Ql prog2 . 2097ac1f02eSThomas Quinot.Pp 210a144588dSDavid MaloneA 211a144588dSDavid Malone.Em hostname 212a144588dSDavid Malonespecification of the form 213a144588dSDavid Malone.Ql #+hostname 214a144588dSDavid Maloneor 215a144588dSDavid Malone.Ql +hostname 2166b010ec6STom Rhodesmeans the following blocks will be applied to messages 217a144588dSDavid Malonereceived from the specified hostname. 2186b010ec6STom RhodesAlternatively, the 219a144588dSDavid Malone.Em hostname 220a144588dSDavid Malonespecification 221a144588dSDavid Malone.Ql #-hostname 222a144588dSDavid Maloneor 223a144588dSDavid Malone.Ql -hostname 224a144588dSDavid Malonecauses the following blocks to be applied to messages 225a144588dSDavid Malonefrom any host but the one specified. 226a144588dSDavid MaloneIf the hostname is given as 227a144588dSDavid Malone.Ql @ , 228a144588dSDavid Malonethe local hostname will be used. 2296fb9b618SGiorgos KeramidasAs for program specifications, multiple comma-separated 2307ac1f02eSThomas Quinotvalues may be specified for hostname specifications. 2317ac1f02eSThomas Quinot.Pp 232a144588dSDavid MaloneA 233a144588dSDavid Malone.Em program 234a144588dSDavid Maloneor 235a144588dSDavid Malone.Em hostname 236a144588dSDavid Malonespecification may be reset by giving the program or hostname as 237a144588dSDavid Malone.Ql * . 238f8c034f9SJordan K. Hubbard.Pp 239dea673e9SRodney W. GrimesSee 240dea673e9SRodney W. Grimes.Xr syslog 3 2416b010ec6STom Rhodesfor further descriptions of both the 242dea673e9SRodney W. Grimes.Em facility 243dea673e9SRodney W. Grimesand 244dea673e9SRodney W. Grimes.Em level 245f2e366a1SSheldon Hearnkeywords and their significance. 24636a142c4SRuslan ErmilovIt is preferred that selections be made on 247f8c034f9SJordan K. Hubbard.Em facility 248f8c034f9SJordan K. Hubbardrather than 249f8c034f9SJordan K. Hubbard.Em program , 250f2e366a1SSheldon Hearnsince the latter can easily vary in a networked environment. 251f2e366a1SSheldon HearnIn some cases, 252f8c034f9SJordan K. Hubbardthough, an appropriate 253f8c034f9SJordan K. Hubbard.Em facility 2540227791bSRuslan Ermilovsimply does not exist. 255dea673e9SRodney W. Grimes.Pp 256dea673e9SRodney W. GrimesIf a received message matches the specified 257dea673e9SRodney W. Grimes.Em facility 258dea673e9SRodney W. Grimesand is of the specified 259dea673e9SRodney W. Grimes.Em level 260dea673e9SRodney W. Grimes.Em (or a higher level) , 261f8c034f9SJordan K. Hubbardand the first word in the message after the date matches the 262f8c034f9SJordan K. Hubbard.Em program , 263dea673e9SRodney W. Grimesthe action specified in the 264dea673e9SRodney W. Grimes.Em action 265dea673e9SRodney W. Grimesfield will be taken. 266dea673e9SRodney W. Grimes.Pp 267dea673e9SRodney W. GrimesMultiple 268dea673e9SRodney W. Grimes.Em selectors 269dea673e9SRodney W. Grimesmay be specified for a single 270dea673e9SRodney W. Grimes.Em action 27124685462SJohn-Mark Gurneyby separating them with semicolon 27224685462SJohn-Mark Gurney.Pq Dq \&; 27324685462SJohn-Mark Gurneycharacters. 274dea673e9SRodney W. GrimesIt is important to note, however, that each 275dea673e9SRodney W. Grimes.Em selector 276dea673e9SRodney W. Grimescan modify the ones preceding it. 277dea673e9SRodney W. Grimes.Pp 278dea673e9SRodney W. GrimesMultiple 279dea673e9SRodney W. Grimes.Em facilities 280dea673e9SRodney W. Grimesmay be specified for a single 281dea673e9SRodney W. Grimes.Em level 28224685462SJohn-Mark Gurneyby separating them with comma 28324685462SJohn-Mark Gurney.Pq Dq \&, 28424685462SJohn-Mark Gurneycharacters. 285dea673e9SRodney W. Grimes.Pp 28624685462SJohn-Mark GurneyAn asterisk 28724685462SJohn-Mark Gurney.Pq Dq * 28824685462SJohn-Mark Gurneycan be used to specify all 2896b010ec6STom Rhodes.Em facilities , 290f8c034f9SJordan K. Hubbardall 2916b010ec6STom Rhodes.Em levels , 292dea673e9SRodney W. Grimesor all 293f8c034f9SJordan K. Hubbard.Em programs . 294dea673e9SRodney W. Grimes.Pp 295dea673e9SRodney W. GrimesThe special 296dea673e9SRodney W. Grimes.Em facility 29724685462SJohn-Mark Gurney.Dq mark 29824685462SJohn-Mark Gurneyreceives a message at priority 29924685462SJohn-Mark Gurney.Dq info 30024685462SJohn-Mark Gurneyevery 20 minutes 301dea673e9SRodney W. Grimes(see 302dea673e9SRodney W. Grimes.Xr syslogd 8 ) . 303dea673e9SRodney W. GrimesThis is not enabled by a 304dea673e9SRodney W. Grimes.Em facility 305dea673e9SRodney W. Grimesfield containing an asterisk. 306dea673e9SRodney W. Grimes.Pp 307dea673e9SRodney W. GrimesThe special 308dea673e9SRodney W. Grimes.Em level 30924685462SJohn-Mark Gurney.Dq none 31024685462SJohn-Mark Gurneydisables a particular 311dea673e9SRodney W. Grimes.Em facility . 312dea673e9SRodney W. Grimes.Pp 313dea673e9SRodney W. GrimesThe 314dea673e9SRodney W. Grimes.Em action 315dea673e9SRodney W. Grimesfield of each line specifies the action to be taken when the 316dea673e9SRodney W. Grimes.Em selector 317dea673e9SRodney W. Grimesfield selects a message. 3185fadfc4cSJoerg WunschThere are five forms: 319dea673e9SRodney W. Grimes.Bl -bullet 320dea673e9SRodney W. Grimes.It 321dea673e9SRodney W. GrimesA pathname (beginning with a leading slash). 322dea673e9SRodney W. GrimesSelected messages are appended to the file. 3230f2ffc4eSDavid Malone.Pp 3240f2ffc4eSDavid MaloneTo ensure that kernel messages are written to disk promptly, 3250f2ffc4eSDavid Malone.Nm 3260f2ffc4eSDavid Malonecalls 3270f2ffc4eSDavid Malone.Xr fsync 2 3280f2ffc4eSDavid Maloneafter writing messages from the kernel. 3290f2ffc4eSDavid MaloneOther messages are not synced explicitly. 3300f2ffc4eSDavid MaloneYou may prefix a pathname with the minus sign, 3310f2ffc4eSDavid Malone.Dq - , 3320f2ffc4eSDavid Maloneto forego syncing the specified file after every kernel message. 3330f2ffc4eSDavid MaloneNote that you might lose information if the system crashes 3340f2ffc4eSDavid Maloneimmediately following a write attempt. 3350f2ffc4eSDavid MaloneNevertheless, using the 3360f2ffc4eSDavid Malone.Dq - 3370f2ffc4eSDavid Maloneoption may improve performance, 3380f2ffc4eSDavid Maloneespecially if the kernel is logging many messages. 339dea673e9SRodney W. Grimes.It 34024685462SJohn-Mark GurneyA hostname (preceded by an at 34124685462SJohn-Mark Gurney.Pq Dq @ 34224685462SJohn-Mark Gurneysign). 343dea673e9SRodney W. GrimesSelected messages are forwarded to the 344922a51eeSPhilippe Charnier.Xr syslogd 8 345dea673e9SRodney W. Grimesprogram on the named host. 346be389c75SJulian ElischerIf a port number is added after a colon 347bc84aa4bSRuslan Ermilov.Pq Ql :\& 348bc84aa4bSRuslan Ermilovthen that port will be used as the destination port 349bc84aa4bSRuslan Ermilovrather than the usual syslog port. 350dea673e9SRodney W. Grimes.It 351dea673e9SRodney W. GrimesA comma separated list of users. 352dea673e9SRodney W. GrimesSelected messages are written to those users 353dea673e9SRodney W. Grimesif they are logged in. 354dea673e9SRodney W. Grimes.It 355dea673e9SRodney W. GrimesAn asterisk. 356dea673e9SRodney W. GrimesSelected messages are written to all logged-in users. 3575fadfc4cSJoerg Wunsch.It 35824685462SJohn-Mark GurneyA vertical bar 35924685462SJohn-Mark Gurney.Pq Dq \&| , 36024685462SJohn-Mark Gurneyfollowed by a command to pipe the selected 36107bfccd7SRuslan Ermilovmessages to. 36207bfccd7SRuslan ErmilovThe command is passed to 3637ae71655SCrist J. Clark.Xr sh 1 3645fadfc4cSJoerg Wunschfor evaluation, so usual shell metacharacters or input/output 36507bfccd7SRuslan Ermilovredirection can occur. 36607bfccd7SRuslan Ermilov(Note however that redirecting 3675fadfc4cSJoerg Wunsch.Xr stdio 3 3685fadfc4cSJoerg Wunschbuffered output from the invoked command can cause additional delays, 3695fadfc4cSJoerg Wunschor even lost output data in case a logging subprocess exited with a 370455fb174SRuslan Ermilovsignal.) 371455fb174SRuslan ErmilovThe command itself runs with 3725fadfc4cSJoerg Wunsch.Em stdout 3735fadfc4cSJoerg Wunschand 3745fadfc4cSJoerg Wunsch.Em stderr 3755fadfc4cSJoerg Wunschredirected to 3765fadfc4cSJoerg Wunsch.Pa /dev/null . 3775fadfc4cSJoerg WunschUpon receipt of a 3785fadfc4cSJoerg Wunsch.Dv SIGHUP , 3797ae71655SCrist J. Clark.Xr syslogd 8 38007bfccd7SRuslan Ermilovwill close the pipe to the process. 3810227791bSRuslan ErmilovIf the process did not exit 3827fa793ccSMike Pritchardvoluntarily, it will be sent a 3835fadfc4cSJoerg Wunsch.Dv SIGTERM 38481be6c75SJoerg Wunschsignal after a grace period of up to 60 seconds. 3855fadfc4cSJoerg Wunsch.Pp 3867fa793ccSMike PritchardThe command will only be started once data arrives that should be piped 38707bfccd7SRuslan Ermilovto it. 38807bfccd7SRuslan ErmilovIf it exited later, it will be restarted as necessary. 38907bfccd7SRuslan ErmilovSo if it 39081be6c75SJoerg Wunschis desired that the subprocess should get exactly one line of input only 39181be6c75SJoerg Wunsch(which can be very resource-consuming if there are a lot of messages 39281be6c75SJoerg Wunschflowing quickly), this can be achieved by exiting after just one line of 39307bfccd7SRuslan Ermilovinput. 39407bfccd7SRuslan ErmilovIf necessary, a script wrapper can be written to this effect. 3955fadfc4cSJoerg Wunsch.Pp 39636a142c4SRuslan ErmilovUnless the command is a full pipeline, it is probably useful to 3975fadfc4cSJoerg Wunschstart the command with 3985fadfc4cSJoerg Wunsch.Em exec 3995fadfc4cSJoerg Wunschso that the invoking shell process does not wait for the command to 40007bfccd7SRuslan Ermilovcomplete. 40107bfccd7SRuslan ErmilovWarning: the process is started under the UID invoking 4025fadfc4cSJoerg Wunsch.Xr syslogd 8 , 4037fa793ccSMike Pritchardnormally the superuser. 404dea673e9SRodney W. Grimes.El 405dea673e9SRodney W. Grimes.Pp 40624685462SJohn-Mark GurneyBlank lines and lines whose first non-blank character is a hash 40724685462SJohn-Mark Gurney.Pq Dq # 408dea673e9SRodney W. Grimescharacter are ignored. 4097e1535c5SMaxim SobolevIf 4107e1535c5SMaxim Sobolev.Ql # 4117e1535c5SMaxim Sobolevis placed in the middle of the line, the 4127e1535c5SMaxim Sobolev.Ql # 4137e1535c5SMaxim Sobolevcharacter and the rest of the line after it is ignored. 4147e1535c5SMaxim SobolevTo prevent special meaning, the 4157e1535c5SMaxim Sobolev.Ql # 4167e1535c5SMaxim Sobolevcharacter may be escaped with 4177e1535c5SMaxim Sobolev.Ql \e ; 4187e1535c5SMaxim Sobolevin this case preceding 4197e1535c5SMaxim Sobolev.Ql \e 4207e1535c5SMaxim Sobolevis removed and 4217e1535c5SMaxim Sobolev.Ql # 4227e1535c5SMaxim Sobolevis treated as an ordinary character. 42359a3c79dSRuslan Ermilov.Sh IMPLEMENTATION NOTES 42459a3c79dSRuslan ErmilovThe 42559a3c79dSRuslan Ermilov.Dq kern 42659a3c79dSRuslan Ermilovfacility is usually reserved for messages 42759a3c79dSRuslan Ermilovgenerated by the local kernel. 42859a3c79dSRuslan ErmilovOther messages logged with facility 42959a3c79dSRuslan Ermilov.Dq kern 43059a3c79dSRuslan Ermilovare usually translated to facility 43159a3c79dSRuslan Ermilov.Dq user . 43259a3c79dSRuslan ErmilovThis translation can be disabled; 43359a3c79dSRuslan Ermilovsee 43459a3c79dSRuslan Ermilov.Xr syslogd 8 43559a3c79dSRuslan Ermilovfor details. 43659a3c79dSRuslan Ermilov.Sh FILES 43759a3c79dSRuslan Ermilov.Bl -tag -width /etc/syslog.conf -compact 43859a3c79dSRuslan Ermilov.It Pa /etc/syslog.conf 43959a3c79dSRuslan Ermilov.Xr syslogd 8 44059a3c79dSRuslan Ermilovconfiguration file 44159a3c79dSRuslan Ermilov.El 442dea673e9SRodney W. Grimes.Sh EXAMPLES 443dea673e9SRodney W. GrimesA configuration file might appear as follows: 444dea673e9SRodney W. Grimes.Bd -literal 445dea673e9SRodney W. Grimes# Log all kernel messages, authentication messages of 4466b010ec6STom Rhodes# level notice or higher, and anything of level err or 447dea673e9SRodney W. Grimes# higher to the console. 448dea673e9SRodney W. Grimes# Don't log private authentication messages! 4495b34e708STom Rhodes*.err;kern.*;auth.notice;authpriv.none;mail.crit /dev/console 450dea673e9SRodney W. Grimes 451dea673e9SRodney W. Grimes# Log anything (except mail) of level info or higher. 452dea673e9SRodney W. Grimes# Don't log private authentication messages! 453dea673e9SRodney W. Grimes*.info;mail.none;authpriv.none /var/log/messages 454dea673e9SRodney W. Grimes 4552eec1ab0SPoul-Henning Kamp# Log daemon messages at debug level only 4562eec1ab0SPoul-Henning Kampdaemon.=debug /var/log/daemon.debug 4572eec1ab0SPoul-Henning Kamp 458dea673e9SRodney W. Grimes# The authpriv file has restricted access. 459dea673e9SRodney W. Grimesauthpriv.* /var/log/secure 460dea673e9SRodney W. Grimes 461dea673e9SRodney W. Grimes# Log all the mail messages in one place. 462dea673e9SRodney W. Grimesmail.* /var/log/maillog 463dea673e9SRodney W. Grimes 464dea673e9SRodney W. Grimes# Everybody gets emergency messages, plus log them on another 465dea673e9SRodney W. Grimes# machine. 466dea673e9SRodney W. Grimes*.emerg * 467dea673e9SRodney W. Grimes*.emerg @arpa.berkeley.edu 468dea673e9SRodney W. Grimes 469dea673e9SRodney W. Grimes# Root and Eric get alert and higher messages. 470dea673e9SRodney W. Grimes*.alert root,eric 471dea673e9SRodney W. Grimes 472dea673e9SRodney W. Grimes# Save mail and news errors of level err and higher in a 473dea673e9SRodney W. Grimes# special file. 474dea673e9SRodney W. Grimesuucp,news.crit /var/log/spoolerr 475f8c034f9SJordan K. Hubbard 4765fadfc4cSJoerg Wunsch# Pipe all authentication messages to a filter. 4775fadfc4cSJoerg Wunschauth.* |exec /usr/local/sbin/authfilter 4785fadfc4cSJoerg Wunsch 479f8c034f9SJordan K. Hubbard# Save ftpd transactions along with mail and news 480f8c034f9SJordan K. Hubbard!ftpd 481f8c034f9SJordan K. Hubbard*.* /var/log/spoolerr 482d2b4b1faSJulian Elischer 483fa62586aSBrian Feldman# Log all security messages to a separate file. 484fa62586aSBrian Feldmansecurity.* /var/log/security 4855c620e2dSChris Timmons 4865c620e2dSChris Timmons# Log all writes to /dev/console to a separate file. 4875c620e2dSChris Timmonsconsole.* /var/log/console.log 4880f2ffc4eSDavid Malone 4890f2ffc4eSDavid Malone# Log ipfw messages without syncing after every message. 4900f2ffc4eSDavid Malone!ipfw 4910f2ffc4eSDavid Malone*.* -/var/log/ipfw 492dea673e9SRodney W. Grimes.Ed 49359a3c79dSRuslan Ermilov.Sh SEE ALSO 49459a3c79dSRuslan Ermilov.Xr syslog 3 , 495481a1902SDavid Malone.Xr syslogd 8 496dea673e9SRodney W. Grimes.Sh BUGS 497922a51eeSPhilippe CharnierThe effects of multiple 498922a51eeSPhilippe Charnier.Em selectors 499922a51eeSPhilippe Charnierare sometimes not intuitive. 50024685462SJohn-Mark GurneyFor example 50124685462SJohn-Mark Gurney.Dq mail.crit,*.err 50224685462SJohn-Mark Gurneywill select 50324685462SJohn-Mark Gurney.Dq mail 50424685462SJohn-Mark Gurneyfacility messages at the level of 50524685462SJohn-Mark Gurney.Dq err 50624685462SJohn-Mark Gurneyor higher, not at the level of 50724685462SJohn-Mark Gurney.Dq crit 50824685462SJohn-Mark Gurneyor higher. 509605efc87SJoerg Wunsch.Pp 510605efc87SJoerg WunschIn networked environments, note that not all operating systems 51107bfccd7SRuslan Ermilovimplement the same set of facilities. 51207bfccd7SRuslan ErmilovThe facilities 513605efc87SJoerg Wunschauthpriv, cron, ftp, and ntp that are known to this implementation 51407bfccd7SRuslan Ermilovmight be absent on the target system. 51507bfccd7SRuslan ErmilovEven worse, DEC UNIX uses 516605efc87SJoerg Wunschfacility number 10 (which is authpriv in this implementation) to 517605efc87SJoerg Wunschlog events for their AdvFS file system. 518