1 .\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" from SYSLOG 3 "15 Feb 1994" "Linux" "Linux Programmer's Manual"
24 .\" Modified for Minix porting by G. Falzoni <gfalzoni@inwind.it>
47 .TH SYSLOG 3 "Jan. 18, 2000"
49 openlog, syslog, closelog \- send messages to the system logger
51 .B #include <syslog.h>
53 .BI "void openlog(char " *ident ", int " option ", int " facility)
55 .BI "void syslog(int " priority ", char " *format ", ...)"
57 .BI "void closelog(void)"
61 opens a connection to the system logger for a program. The string pointed to by
63 is added to each message, and is typically set to the program name. Values for
67 are given in the next section. Its use is optional. It will automatically be called by
69 if necessary, in which case
71 will default to "syslog".
74 generates a log message, which will be distributed by
77 is a combination of the
81 values for which are given in the next section. The remaining arguments
86 and any arguments required by the
88 .\" except that the two character %m will be replaced by the error message string
90 .\" corresponding to the present value of
94 closes the descriptor being used to write to the system logger. Its use is optional.
96 This section lists the parameters used to set the values of
97 .IR option , " facility" ", and " priority .
103 is an OR of any of these:
106 write directly to system console if there is an error while sending to
110 open the connection immediately (normally, the connection is opened when
111 the first message is logged)
114 print to stderr as well
117 include PID with each message
121 argument is used to specify what type of program is logging the message.
122 This lets the configuration file specify that messages from different
123 facilities will be handled differently.
126 security/authorization messages (DEPRECATED Use
131 security/authorization messages (private)
135 .RB ( cron " and " at )
143 .BR LOG_LOCAL0 " through " LOG_LOCAL7
144 reserved for local use
147 line printer subsystem
153 USENET news subsystem
156 messages generated internally by
159 .BR LOG_USER (default)
160 generic user-level messages
165 This determines the importance of the message. The levels are, in order
166 of decreasing importance:
172 action must be taken immediately
184 normal, but significant, condition
187 informational message
194 function call appeared in BSD 4.2.