source: trunk/minix/man/man3/syslog.3@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 4.5 KB
Line 
1.\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com)
2.\"
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.
6.\"
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
11.\"
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
18.\" professionally.
19.\"
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
23.\" from SYSLOG 3 "15 Feb 1994" "Linux" "Linux Programmer's Manual"
24.\" Modified for Minix porting by G. Falzoni <gfalzoni@inwind.it>
25.\" $Id: syslog.3,v 1.1 2006/04/03 14:59:51 beng Exp $
26.\"
27.\" Local macros
28.de Xr
29.BR \\$1 (\\$2)\\$3
30..
31.de LB
32.TP \\$1
33\\fB\\$2\\fR
34\\$3
35..
36.de LI
37.TP \\$1
38\\fI\\$2\\fR
39\\$3
40..
41.de LR
42.TP \\$1
43\\fR\\$2\\fR
44\\$3
45..
46.\" end local macros
47.TH SYSLOG 3 "Jan. 18, 2000"
48.SH NAME
49openlog, syslog, closelog \- send messages to the system logger
50.SH SYNOPSIS
51.B #include <syslog.h>
52.sp
53.BI "void openlog(char " *ident ", int " option ", int " facility)
54.sp
55.BI "void syslog(int " priority ", char " *format ", ...)"
56.sp
57.BI "void closelog(void)"
58.sp
59.SH DESCRIPTION
60.B openlog()
61opens a connection to the system logger for a program. The string pointed to by
62.I ident
63is added to each message, and is typically set to the program name. Values for
64.I option
65and
66.I facility
67are given in the next section. Its use is optional. It will automatically be called by
68.B syslog()
69if necessary, in which case
70.I ident
71will default to "syslog".
72.sp
73.B syslog()
74generates a log message, which will be distributed by
75.Xr syslogd 8 .
76.I priority
77is a combination of the
78.I facility
79and the
80.IR level ,
81values for which are given in the next section. The remaining arguments
82are a
83.IR format ,
84as in
85.Xr printf 3
86and any arguments required by the
87.IR format .
88.\" except that the two character %m will be replaced by the error message string
89.\" RI ( strerror )
90.\" corresponding to the present value of
91.\" IR errno .
92.sp
93.B closelog()
94closes the descriptor being used to write to the system logger. Its use is optional.
95.SH "PARAMETERS"
96This section lists the parameters used to set the values of
97.IR option , " facility" ", and " priority .
98.SS option
99The
100.I option
101argument to
102.B openlog()
103is an OR of any of these:
104.TP
105.B LOG_CONS
106write directly to system console if there is an error while sending to
107system logger
108.TP
109.B LOG_NDELAY
110open the connection immediately (normally, the connection is opened when
111the first message is logged)
112.TP
113.B LOG_PERROR
114print to stderr as well
115.TP
116.B LOG_PID
117include PID with each message
118.SS facility
119The
120.I facility
121argument is used to specify what type of program is logging the message.
122This lets the configuration file specify that messages from different
123facilities will be handled differently.
124.TP
125.B LOG_AUTH
126security/authorization messages (DEPRECATED Use
127.B LOG_AUTHPRIV
128instead)
129.TP
130.B LOG_AUTHPRIV
131security/authorization messages (private)
132.TP
133.B LOG_CRON
134clock daemon
135.RB ( cron " and " at )
136.TP
137.B LOG_DAEMON
138other system daemons
139.TP
140.B LOG_KERN
141kernel messages
142.TP
143.BR LOG_LOCAL0 " through " LOG_LOCAL7
144reserved for local use
145.TP
146.B LOG_LPR
147line printer subsystem
148.TP
149.B LOG_MAIL
150mail subsystem
151.TP
152.B LOG_NEWS
153USENET news subsystem
154.TP
155.B LOG_SYSLOG
156messages generated internally by
157.B syslogd
158.TP
159.BR LOG_USER (default)
160generic user-level messages
161.TP
162.B LOG_UUCP
163UUCP subsystem
164.SS level
165This determines the importance of the message. The levels are, in order
166of decreasing importance:
167.TP
168.B LOG_EMERG
169system is unusable
170.TP
171.B LOG_ALERT
172action must be taken immediately
173.TP
174.B LOG_CRIT
175critical conditions
176.TP
177.B LOG_ERR
178error conditions
179.TP
180.B LOG_WARNING
181warning conditions
182.TP
183.B LOG_NOTICE
184normal, but significant, condition
185.TP
186.B LOG_INFO
187informational message
188.TP
189.B LOG_DEBUG
190debug-level message
191.SH HISTORY
192A
193.B syslog
194function call appeared in BSD 4.2.
195.SH SEE ALSO
196.Xr logger 1 ,
197.Xr syslog.conf 5 ,
198.Xr syslogd 8 .
Note: See TracBrowser for help on using the repository browser.