1.\" $NetBSD: syslogd.8,v 1.58 2018/11/05 09:22:30 wiz Exp $ 2.\" 3.\" Copyright (c) 1983, 1986, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" from: @(#)syslogd.8 8.1 (Berkeley) 6/6/93 31.\" 32.Dd November 4, 2018 33.Dt SYSLOGD 8 34.Os 35.Sh NAME 36.Nm syslogd 37.Nd log systems messages 38.Sh SYNOPSIS 39.Nm 40.Op Fl dnrSsTUvX 41.Op Fl B Ar buffer_length 42.Op Fl b Ar bind_address 43.Op Fl f Ar config_file 44.Op Fl g Ar group 45.Op Fl m Ar mark_interval 46.Op Fl o Ar output_format 47.Op Fl P Ar file_list 48.Oo 49.Fl p Ar log_socket 50.Op Fl p Ar log_socket2 ... 51.Oc 52.Op Fl t Ar chroot_dir 53.Op Fl u Ar user 54.Sh DESCRIPTION 55.Nm 56reads and logs messages to the system console, log files, other 57machines and/or users as specified by its configuration file. 58The options are as follows: 59.Bl -tag -width 15n 60.It Fl B Ar buffer_length 61Sets the receiving buffer length. 62The default is 16384 bytes. 63If syslogd reports buffer overflow, this needs increasing. 64If you don't care about it being reported, see the 65.Fl X 66option. 67.It Fl b Ar bind_address 68Specify one specific IP address or hostname to bind to. 69If a hostname is specified, the IPv4 or IPv6 address 70which corresponds to it is used. 71.It Fl d 72Enable debugging to the standard output, 73and do not disassociate from the controlling terminal. 74.It Fl f Ar config_file 75Specify the pathname of an alternative configuration file; 76the default is 77.Pa /etc/syslog.conf . 78.It Fl g Ar group 79Set GID to 80.Ar group 81after the sockets and log files have been opened. 82.It Fl m Ar mark_interval 83Select the number of minutes between ``mark'' messages; 84the default is 20 minutes. 85.It Fl n 86Do not perform hostname lookups; report only numeric addresses. 87.It Fl o Ar output_format 88Select output message format. 89.Bl -hang 90.It Em bsd , rfc3164 91traditional BSD Syslog format (default) 92.It Em syslog , rfc5424 93new syslog-protocol format 94.El 95.It Fl P 96Specify the pathname of a file containing a list of sockets to be 97created. 98The format of the file is simply one socket per line. 99.It Fl p Ar log_socket 100Specify the pathname of a log socket. 101Multiple 102.Fl p 103options create multiple log sockets. 104If no 105.Fl p 106arguments are given, the default socket of 107.Pa /var/run/log 108is used. 109.It Fl r 110Disable the compression of repeated instances of the same line 111into a single line of the form 112.Dq last message repeated N times . 113.It Fl S 114Sync kernel messages to disk immediately. 115.It Fl s 116Select 117.Dq secure 118mode, in which 119.Nm 120does not listen on a UDP socket but only communicates over a 121.Ux 122domain socket. 123This is valuable when the machine on 124which 125.Nm 126runs is subject to attack over the network and it is desired 127that the machine be protected from attempts to remotely fill logs 128and similar attacks. 129.It Fl T 130Always use the local time and date for messages received from the 131network, instead of the timestamp field supplied in the message 132by the remote host. 133This is useful if some of the originating hosts can't keep time 134properly or are unable to generate a correct timestamp. 135.It Fl t Ar chroot_dir 136.Xr chroot 2 137to 138.Ar chroot_dir 139after the sockets and log files have been opened. 140.It Fl U 141Unique priority logging. 142Only log messages at the priority specified by the selector in the 143configuration file. 144Without this option, messages at the specified priority or higher are 145logged. 146This option changes the default priority comparison from 147.Sq >= 148to 149.Sq = . 150.It Fl u Ar user 151Set UID to 152.Ar user 153after the sockets and log files have been opened. 154.It Fl v 155Verbose logging. 156If specified once, the numeric facility and priority are logged with 157each locally-written message. 158If specified more than once, the names of the facility and priority are 159logged with each locally-written message. 160.It Fl X 161Disable logging of buffer overflow. 162.El 163.Pp 164.Nm 165reads its configuration file when it starts up and whenever it 166receives a hangup signal. 167For information on the format of the configuration file, 168see 169.Xr syslog.conf 5 . 170.Pp 171.Nm 172reads messages from the 173.Ux 174domain socket 175.Pa /var/run/log , 176from an Internet domain socket specified in 177.Pa /etc/services , 178and from the special device 179.Pa /dev/klog 180(to read kernel messages). 181.Pp 182.Nm 183creates the file 184.Pa /var/run/syslogd.pid , 185and stores its process 186id there. 187This can be used to kill or reconfigure 188.Nm . 189.Pp 190By using multiple 191.Fl p 192options, one can set up many chroot environments by passing the pathname 193to the log socket 194.Pa ( /var/run/log ) 195in each chroot area to 196.Nm . 197For example: 198.Dl syslogd -p /var/run/log -p /web/var/run/log -p /ftp/var/run/log 199.Pp 200Note: the normal log socket must now also be passed to 201.Nm . 202.Pp 203The logged message includes the date, time, and hostname (or pathname of 204the log socket). 205Commonly, the program name and the process id is included. 206.Pp 207The date and time are taken from the received message. 208If the format of the timestamp field is incorrect, time obtained from 209the local host is used instead. 210This can be overridden by the 211.Fl T 212flag. 213.Pp 214Accesses from UDP socket can be filtered by libwrap configuration files, like 215.Pa /etc/hosts.deny . 216Specify 217.Dq Li syslogd 218in 219.Ar daemon_list 220portion of the configuration files. 221Refer to 222.Xr hosts_access 5 223for details. 224.Ss SYSLOG PROTOCOL NOTES 225.Nm 226accepts messages in traditional BSD Syslog or in newer Syslog Protocol 227format. 228See RFC 3164 (BSD Syslog) and RFC 5424 (Syslog Protocol) for detailed 229description of the message format. 230Messages from the local kernel that are not tagged with a priority code 231receive the default facility 232.Dv LOG_KERN 233and priority 234.Dv LOG_NOTICE . 235All other untagged messages receive the default facility 236.Dv LOG_USER 237and priority 238.Dv LOG_NOTICE . 239.Sh FILES 240.Bl -tag -width /var/run/syslogd.pid -compact 241.It Pa /etc/syslog.conf 242The configuration file. 243.It Pa /var/run/syslogd.pid 244The process id of current 245.Nm . 246.It Pa /var/run/log 247Name of the 248.Ux 249domain datagram log socket. 250.It Pa /dev/klog 251The kernel log device. 252.El 253.Sh SEE ALSO 254.Xr logger 1 , 255.Xr syslog 3 , 256.Xr services 5 , 257.Xr syslog.conf 5 , 258.Xr newsyslog 8 259.Rs 260.%R RFC 261.%N 3164 262.%D August 2001 263.%T The BSD syslog Protocol 264.Re 265.Rs 266.%R RFC 267.%N 5424 268.%D March 2009 269.%T The Syslog Protocol 270.Re 271.Sh HISTORY 272The 273.Nm 274command appeared in 275.Bx 4.3 . 276Support for multiple log sockets appeared in 277.Nx 1.4 . 278libwrap support appeared in 279.Nx 1.6 . 280Support for RFC 5424, TLS encryption and authentication, signed messages 281appeared in 282.Nx 6.0 . 283