The syslog facility


syslog is a standard C library function that provides a standard, central method for programs to generate log data. Two library functions are typically used to set up and generate log messages:

openlog(ident, option, facility)
This function is used to set up logging via syslog in an application. It registers an identifier for the program (typically its name in argv[0], such as "sendmail"), some options for where log messages should go (such as emitting them on stderr in addition to sending them to syslogd), and the specific facility it should log under (from a standard set of facilities, see below).
syslog(priority, format, ...)
Generate a log message with the indicated priority (see below), and supply a message for logging (which can be supplied with a format and arguments similar to those used by printf()).

syslog uses a standard set of facility and priority identifiers which can be used to sort log data into different output destinations (such as files or remote log servers).

Facilities:

auth authpriv cron daemon ftp kern lpr mail mark news security syslog user uucp local0 local1 local2 local3 local4 local5 local6 local7

Priorities (in increasing order of severity):

debug info notice warning err crit alert emerg

Next ->


Steve VanDevender
Last modified: Mon Jul 28 14:04:41 PDT 2003