version 2, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
SYSLOG |
| |
|
2 |
!!!SYSLOG |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
PARAMETERS |
| |
|
7 |
HISTORY |
| |
|
8 |
SEE ALSO |
| |
|
9 |
---- |
| |
|
10 |
!!NAME |
| |
|
11 |
|
| |
|
12 |
|
| |
|
13 |
closelog, openlog, syslog - send messages to the system logger |
| |
|
14 |
!!SYNOPSIS |
| |
|
15 |
|
| |
|
16 |
|
| |
|
17 |
__#include __ |
| |
|
18 |
|
| |
|
19 |
|
| |
|
20 |
__void openlog( char__ ''*ident''__, int__ |
| |
|
21 |
''option''__, int__ |
| |
|
22 |
''facility''__)__ |
| |
|
23 |
|
| |
|
24 |
|
| |
|
25 |
__void syslog( int__ ''priority''__, char__ |
| |
|
26 |
''*format''__, ...)__ |
| |
|
27 |
|
| |
|
28 |
|
| |
|
29 |
__void closelog( void )__ |
| |
|
30 |
!!DESCRIPTION |
| |
|
31 |
|
| |
|
32 |
|
| |
|
33 |
__closelog()__ closes the descriptor being used to write |
| |
|
34 |
to the system logger. The use of __closelog()__ is |
| |
|
35 |
optional. |
| |
|
36 |
|
| |
|
37 |
|
| |
|
38 |
__openlog()__ opens a connection to the system logger for |
| |
|
39 |
a program. The string pointed to by ''ident'' is added to |
| |
|
40 |
each message, and is typically set to the program name. |
| |
|
41 |
Values for ''option'' and ''facility'' are given in |
| |
|
42 |
the next section. The use of __openlog()__ is optional; |
| |
|
43 |
It will automatically be called by __syslog()__ if |
| |
|
44 |
necessary, in which case ''ident'' will default to |
| |
|
45 |
NULL. |
| |
|
46 |
|
| |
|
47 |
|
| |
|
48 |
__syslog()__ generates a log message, which will be |
| |
|
49 |
distributed by syslogd(8). ''priority'' is a |
| |
|
50 |
combination of the ''facility'' and the ''level'', |
| |
|
51 |
values for which are given in the next section. The |
| |
|
52 |
remaining arguments are a ''format'', as in |
| |
|
53 |
printf(3) and any arguments required by the |
| |
|
54 |
''format'', except that the two character %m will be |
| |
|
55 |
replaced by the error message string (''strerror'') |
| |
|
56 |
corresponding to the present value of |
| |
|
57 |
''errno''. |
| |
|
58 |
!!PARAMETERS |
| |
|
59 |
|
| |
|
60 |
|
| |
|
61 |
This section lists the parameters used to set the values of |
| |
|
62 |
''option'', ''facility'', and |
| |
|
63 |
''priority''. |
| |
|
64 |
|
| |
|
65 |
|
| |
|
66 |
__option__ |
| |
|
67 |
|
| |
|
68 |
|
| |
|
69 |
The ''option'' argument to __openlog()__ is an OR of |
| |
|
70 |
any of these: |
| |
|
71 |
|
| |
|
72 |
|
| |
|
73 |
__LOG_CONS__ |
| |
|
74 |
|
| |
|
75 |
|
| |
|
76 |
write directly to system console if there is an error while |
| |
|
77 |
sending to system logger |
| |
|
78 |
|
| |
|
79 |
|
| |
|
80 |
__LOG_NDELAY__ |
| |
|
81 |
|
| |
|
82 |
|
| |
|
83 |
open the connection immediately (normally, the connection is |
| |
|
84 |
opened when the first message is logged) |
| |
|
85 |
|
| |
|
86 |
|
| |
|
87 |
__LOG_PERROR__ |
| |
|
88 |
|
| |
|
89 |
|
| |
|
90 |
print to stderr as well |
| |
|
91 |
|
| |
|
92 |
|
| |
|
93 |
__LOG_PID__ |
| |
|
94 |
|
| |
|
95 |
|
| |
|
96 |
include PID with each message |
| |
|
97 |
|
| |
|
98 |
|
| |
|
99 |
__facility__ |
| |
|
100 |
|
| |
|
101 |
|
| |
|
102 |
The ''facility'' argument is used to specify what type of |
| |
|
103 |
program is logging the message. This lets the configuration |
| |
|
104 |
file specify that messages from different facilities will be |
| |
|
105 |
handled differently. |
| |
|
106 |
|
| |
|
107 |
|
| |
|
108 |
__LOG_AUTH__ |
| |
|
109 |
|
| |
|
110 |
|
| |
|
111 |
security/authorization messages (DEPRECATED Use |
| |
|
112 |
__LOG_AUTHPRIV__ instead) |
| |
|
113 |
|
| |
|
114 |
|
| |
|
115 |
__LOG_AUTHPRIV__ |
| |
|
116 |
|
| |
|
117 |
|
| |
|
118 |
security/authorization messages (private) |
| |
|
119 |
|
| |
|
120 |
|
| |
|
121 |
__LOG_CRON__ |
| |
|
122 |
|
| |
|
123 |
|
| |
|
124 |
clock daemon (__cron__ and __at__) |
| |
|
125 |
|
| |
|
126 |
|
| |
|
127 |
__LOG_DAEMON__ |
| |
|
128 |
|
| |
|
129 |
|
| |
|
130 |
system daemons without separate facility value |
| |
|
131 |
|
| |
|
132 |
|
| |
|
133 |
__LOG_FTP__ |
| |
|
134 |
|
| |
|
135 |
|
| |
|
136 |
ftp daemon |
| |
|
137 |
|
| |
|
138 |
|
| |
|
139 |
__LOG_KERN__ |
| |
|
140 |
|
| |
|
141 |
|
| |
|
142 |
kernel messages |
| |
|
143 |
|
| |
|
144 |
|
| |
|
145 |
__LOG_LOCAL0__ through __LOG_LOCAL7__ |
| |
|
146 |
|
| |
|
147 |
|
| |
|
148 |
reserved for local use |
| |
|
149 |
|
| |
|
150 |
|
| |
|
151 |
__LOG_LPR__ |
| |
|
152 |
|
| |
|
153 |
|
| |
|
154 |
line printer subsystem |
| |
|
155 |
|
| |
|
156 |
|
| |
|
157 |
__LOG_MAIL__ |
| |
|
158 |
|
| |
|
159 |
|
| |
|
160 |
mail subsystem |
| |
|
161 |
|
| |
|
162 |
|
| |
|
163 |
__LOG_NEWS__ |
| |
|
164 |
|
| |
|
165 |
|
| |
|
166 |
USENET news subsystem |
| |
|
167 |
|
| |
|
168 |
|
| |
|
169 |
__LOG_SYSLOG__ |
| |
|
170 |
|
| |
|
171 |
|
| |
|
172 |
messages generated internally by __syslogd__ |
| |
|
173 |
|
| |
|
174 |
|
| |
|
175 |
__LOG_USER__(default) |
| |
|
176 |
|
| |
|
177 |
|
| |
|
178 |
generic user-level messages |
| |
|
179 |
|
| |
|
180 |
|
| |
|
181 |
__LOG_UUCP__ |
| |
|
182 |
|
| |
|
183 |
|
| |
|
184 |
UUCP subsystem |
| |
|
185 |
|
| |
|
186 |
|
| |
|
187 |
__level__ |
| |
|
188 |
|
| |
|
189 |
|
| |
|
190 |
This determines the importance of the message. The levels |
| |
|
191 |
are, in order of decreasing importance: |
| |
|
192 |
|
| |
|
193 |
|
| |
|
194 |
__LOG_EMERG__ |
| |
|
195 |
|
| |
|
196 |
|
| |
|
197 |
system is unusable |
| |
|
198 |
|
| |
|
199 |
|
| |
|
200 |
__LOG_ALERT__ |
| |
|
201 |
|
| |
|
202 |
|
| |
|
203 |
action must be taken immediately |
| |
|
204 |
|
| |
|
205 |
|
| |
|
206 |
__LOG_CRIT__ |
| |
|
207 |
|
| |
|
208 |
|
| |
|
209 |
critical conditions |
| |
|
210 |
|
| |
|
211 |
|
| |
|
212 |
__LOG_ERR__ |
| |
|
213 |
|
| |
|
214 |
|
| |
|
215 |
error conditions |
| |
|
216 |
|
| |
|
217 |
|
| |
|
218 |
__LOG_WARNING__ |
| |
|
219 |
|
| |
|
220 |
|
| |
|
221 |
warning conditions |
| |
|
222 |
|
| |
|
223 |
|
| |
|
224 |
__LOG_NOTICE__ |
| |
|
225 |
|
| |
|
226 |
|
| |
|
227 |
normal, but significant, condition |
| |
|
228 |
|
| |
|
229 |
|
| |
|
230 |
__LOG_INFO__ |
| |
|
231 |
|
| |
|
232 |
|
| |
|
233 |
informational message |
| |
|
234 |
|
| |
|
235 |
|
| |
|
236 |
__LOG_DEBUG__ |
| |
|
237 |
|
| |
|
238 |
|
| |
|
239 |
debug-level message |
| |
|
240 |
!!HISTORY |
| |
|
241 |
|
| |
|
242 |
|
| |
|
243 |
A __syslog__ function call appeared in BSD |
| |
|
244 |
4.2. |
| |
|
245 |
!!SEE ALSO |
| |
|
246 |
|
| |
|
247 |
|
| 2 |
perry |
248 |
logger(1), syslog.conf(5), |
| 1 |
perry |
249 |
syslogd(8) |
| |
|
250 |
---- |