Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
closelog(3)
Edit
PageHistory
Diff
Info
LikePages
SYSLOG !!!SYSLOG NAME SYNOPSIS DESCRIPTION PARAMETERS HISTORY SEE ALSO ---- !!NAME closelog, openlog, syslog - send messages to the system logger !!SYNOPSIS __#include __ __void openlog( char__ ''*ident''__, int__ ''option''__, int__ ''facility''__)__ __void syslog( int__ ''priority''__, char__ ''*format''__, ...)__ __void closelog( void )__ !!DESCRIPTION __closelog()__ closes the descriptor being used to write to the system logger. The use of __closelog()__ is optional. __openlog()__ opens a connection to the system logger for a program. The string pointed to by ''ident'' is added to each message, and is typically set to the program name. Values for ''option'' and ''facility'' are given in the next section. The use of __openlog()__ is optional; It will automatically be called by __syslog()__ if necessary, in which case ''ident'' will default to NULL. __syslog()__ generates a log message, which will be distributed by syslogd(8). ''priority'' is a combination of the ''facility'' and the ''level'', values for which are given in the next section. The remaining arguments are a ''format'', as in printf(3) and any arguments required by the ''format'', except that the two character %m will be replaced by the error message string (''strerror'') corresponding to the present value of ''errno''. !!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__ system daemons without separate facility value __LOG_FTP__ ftp daemon __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) ----
One page links to
closelog(3)
:
Man3c
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.