| syslogsubmits a message to the Syslog facility.  It does this by
writing to the Unix domain socket/dev/log.
 syslogsubmits the message with the facility and priority indicated
by facility_priority.  The macroLOG_MAKEPRIgenerates a
facility/priority from a facility and a priority, as in the following
example:
 LOG_MAKEPRI(LOG_USER, LOG_WARNING)
 The possible values for the facility code are (macros):
 
LOG_USERA miscellaneous user process
LOG_MAILMail
LOG_DAEMONA miscellaneous system daemon
LOG_AUTHSecurity (authorization)
LOG_SYSLOGSyslog
LOG_LPRCentral printer
LOG_NEWSNetwork news (e.g. Usenet)
LOG_UUCPUUCP
LOG_CRONCron and At
LOG_AUTHPRIVPrivate security (authorization)
LOG_FTPFtp server
LOG_LOCAL0Locally defined
LOG_LOCAL1Locally defined
LOG_LOCAL2Locally defined
LOG_LOCAL3Locally defined
LOG_LOCAL4Locally defined
LOG_LOCAL5Locally defined
LOG_LOCAL6Locally defined
LOG_LOCAL7Locally defined
 Results are undefined if the facility code is anything else.
 note: syslogrecognizes one other facility code: that of
the kernel.  But you can't specify that facility code with these
functions.  If you try, it looks the same tosyslogas if you are
requesting the default facility.  But you wouldn't want to anyway,
because any program that uses the GNU C library is not the kernel. You can use just a priority code as facility_priority.  In that
case, syslogassumes the default facility established when the
Syslog connection was opened.  See Syslog Example. The possible values for the priority code are (macros):
 
LOG_EMERGThe message says the system is unusable. 
LOG_ALERTAction on the message must be taken immediately. 
LOG_CRITThe message states a critical condition. 
LOG_ERRThe message describes an error. 
LOG_WARNINGThe message is a warning. 
LOG_NOTICEThe message describes a normal but important event. 
LOG_INFOThe message is purely informational. 
LOG_DEBUGThe message is only for debugging purposes. 
 Results are undefined if the priority code is anything else.
 If the process does not presently have a Syslog connection open (i.e. 
it did not call openlog),syslogimplicitly opens the
connection the same asopenlogwould, with the following defaults
for information that would otherwise be included in anopenlogcall: The default identification string is the program name.  The
default default facility isLOG_USER.  The default for all the
connection options in options is as if those bits were off.syslogleaves the Syslog connection open. If the dev/logsocket is not open and connected,syslogopens and connects it, the same asopenlogwith theLOG_NDELAYoption would. syslogleaves/dev/logopen and connected unless its attempt
to send the message failed, in which casesyslogcloses it (with the
hope that a future implicit open will restore the Syslog connection to a
usable state).
 Example:
 
#include <syslog.h>
syslog (LOG_MAKEPRI(LOG_LOCAL1, LOG_ERROR),
        "Unable to make network connection to %s.  Error=%m", host);
 |