Sysklogd

syslogd — log systems messages, Article description::utility that reads and logs messages to the system console, logs files, other machines and/or users as specified by its configuration file. Syslogd supports RFC3164 and RFC5424 style log messages for both local and remote logging using Internet and UNIX domain sockets.

Environment variables

 * VAR1
 * VAR2

Files

 * - Global (system wide) configuration file. See syslog.conf(5) for more information.
 * - Conventional sub-directory of .conf files read by syslogd.
 * - Conventional name for default rules.
 * - Default process ID file
 * - Cache of last read sequence number from /dev/kmsg
 * - Name of the UNIX domain datagram log socket
 * - kernel log device

Below is Gentoo's default syslog.conf configuration.

At the end of the main configuration a is included. Additional and optional configuration files can be saved with the *.conf file suffix. And will be available after a restart of the daemon.

For further configuration options read the syslog.conf man page

OpenRC
Add the sysklog daemon to the default runlevel so that logging starts on system boot:

Start the sysklogd daemon now:

Logging to Remote Syslog Server
This rule redirects all messages to one remote host called  with RFC5424 style formatting,

*.*         @2001:db8::1                  ;RFC5424

and another remote host called  but on a non-standard port and with RFC3164 formatting.

*.*         @192.0.2.1:5514               ;RFC3164

Hostname and IP address usage example using RFC3164 formatting:

*.*         @larry.example.org:5514       ;RFC3164

External resources

 * Sysklogd's syslog.conf man file
 * Wikipedia's article about the Syslog protocol
 * RFC 5424 - The Syslog Protocol
 * RFC 3164 - The BSD syslog Protocol