Syslog.conf

From LQWiki
Jump to navigation Jump to search

syslog.conf is the main configuration for syslogd. The purpose of syslog.conf is to specify rules for logging.

Intro

The general syntax of syslog.conf is to provide the type of message being logged followed by the location to store the log file. It is also possible to specify exceptions to logging by using a semicolon followed by the argument which specifies what not to log. The following example is taken from the man page of syslog.conf.

# Store critical stuff in critical
#
*.=crit;kern.none            /var/adm/critical
              
# Kernel messages are first, stored in the kernel
# file, critical messages and higher ones also go
# to another host and to the console
#
kern.*                       /var/adm/kernel
kern.crit                    @finlandia
kern.crit                    /dev/console
kern.info;kern.!err          /var/adm/kernel-info

The first line tells syslogd to store critical logs in /var/adm/critical. The use of ;kern.none tells syslogd not to store any kernel logs. The second set tells syslogd that it should store various types of kernel logs in there own locations.

See also

External Links