table of contents
other languages
other sections
SYSLOG(3) | Linux Programmer's Manual | SYSLOG(3) |
NAME¶
closelog, openlog, syslog - send messages to the system loggerSYNOPSIS¶
#include <syslog.h>DESCRIPTION¶
closelog() closes the descriptor being used to write to the system logger. The use of closelog() is optional.PARAMETERS¶
This section lists the parameters used to set the values of option, facility, and priority.option¶
The option argument to openlog() is an OR of any of these:- LOG_CONS
- write directly to system console if there is an error while sending to system logger
- LOG_NDELAY
- open the connection immediately (normally, the connection is opened when the first message is logged)
- LOG_PERROR
- print to stderr as well
- LOG_PID
- include PID with each message
facility¶
The facility argument is used to specify what type of program is logging the message. This lets the configuration file specify that messages from different facilities will be handled differently.- LOG_AUTH
- security/authorization messages (DEPRECATED Use LOG_AUTHPRIV instead)
- LOG_AUTHPRIV
- security/authorization messages (private)
- LOG_CRON
- clock daemon (cron and at)
- LOG_DAEMON
- other system daemons
- LOG_KERN
- kernel messages
- LOG_LOCAL0 through LOG_LOCAL7
- reserved for local use
- LOG_LPR
- line printer subsystem
- LOG_MAIL
- mail subsystem
- LOG_NEWS
- USENET news subsystem
- LOG_SYSLOG
- messages generated internally by syslogd
- LOG_USER(default)
- generic user-level messages
- LOG_UUCP
- UUCP subsystem
level¶
This determines the importance of the message. The levels are, in order of decreasing importance:- LOG_EMERG
- system is unusable
- LOG_ALERT
- action must be taken immediately
- LOG_CRIT
- critical conditions
- LOG_ERR
- error conditions
- LOG_WARNING
- warning conditions
- LOG_NOTICE
- normal, but significant, condition
- LOG_INFO
- informational message
- LOG_DEBUG
- debug-level message
HISTORY¶
A syslog function call appeared in BSD 4.2.SEE ALSO¶
logger(1), syslog.conf(5), syslogd(8)15 Feb 1994 | Linux |