SYSLOG(3) Library Functions Manual SYSLOG(3)
syslog, openlog, closelog - control system log
syslog(priority, message, parameters ... )
Syslog arranges to write the message onto the system log maintained by
syslog(8). The message is tagged with priority. The message looks
like a printf(3) string except that %m is replaced by the current error
message (collected from errno). A trailing newline is added if needed.
This message will be read by syslog(8) and output to the system console
or files as appropriate.
If special processing is needed, openlog can be called to initialize
the log file. Parameters are ident which is prepended to every mes-
sage, and logstat which is a bit field indicating special status; cur-
rent values are:
LOG_PID log the process id with each message: useful for identifying
instantiations of daemons.
Openlog returns zero on success. If it cannot open the file /dev/log,
it writes on /dev/console instead and returns -1.
Closelog can be used to close the log file.
syslog(LOG_SALERT, "who: internal error 23");
syslog(LOG_INFO, "Connection from host %d", CallingHost);
14 November 1982 SYSLOG(3)