Debian Codegraph @

upstream/opensuse-tumbleweed/man3/Sys::Syslog.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Sys::Syslog 3pm"
61 .TH Sys::Syslog 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Sys::Syslog \- Perl interface to the UNIX syslog(3) calls
68 .SH VERSION
69 .IX Header "VERSION"
70 This is the documentation of version 0.36
71 .SH SYNOPSIS
72 .IX Header "SYNOPSIS"
73 .Vb 2
74 \& use Sys::Syslog; # all except setlogsock()
75 \& use Sys::Syslog qw(:standard :macros); # standard functions & macros
76 \&
77 \& openlog($ident, $logopt, $facility); # don\*(Aqt forget this
78 \& syslog($priority, $format, @args);
79 \& $oldmask = setlogmask($mask_priority);
80 \& closelog();
81 .Ve
82 .SH DESCRIPTION
83 .IX Header "DESCRIPTION"
84 \&\f(CW\*(C`Sys::Syslog\*(C'\fR is an interface to the UNIX \f(CWsyslog(3)\fR program.
85 Call \f(CWsyslog()\fR with a string priority and a list of \f(CWprintf()\fR args
86 just like \f(CWsyslog(3)\fR.
87 .SH EXPORTS
88 .IX Header "EXPORTS"
89 \&\f(CW\*(C`Sys::Syslog\*(C'\fR exports the following \f(CW\*(C`Exporter\*(C'\fR tags:
90 .IP \(bu 4
91 \&\f(CW\*(C`:standard\*(C'\fR exports the standard \f(CWsyslog(3)\fR functions:
92 .Sp
93 .Vb 1
94 \& openlog closelog setlogmask syslog
95 .Ve
96 .IP \(bu 4
97 \&\f(CW\*(C`:extended\*(C'\fR exports the Perl specific functions for \f(CWsyslog(3)\fR:
98 .Sp
99 .Vb 1
100 \& setlogsock
101 .Ve
102 .IP \(bu 4
103 \&\f(CW\*(C`:macros\*(C'\fR exports the symbols corresponding to most of your \f(CWsyslog(3)\fR
104 macros and the \f(CWLOG_UPTO()\fR and \f(CWLOG_MASK()\fR functions.
105 See "CONSTANTS" for the supported constants and their meaning.
106 .PP
107 By default, \f(CW\*(C`Sys::Syslog\*(C'\fR exports the symbols from the \f(CW\*(C`:standard\*(C'\fR tag.
108 .SH FUNCTIONS
109 .IX Header "FUNCTIONS"
110 .ie n .IP "\fBopenlog($ident, \fR\fB$logopt\fR\fB, \fR\fB$facility\fR\fB)\fR" 4
111 .el .IP "\fBopenlog($ident, \fR\f(CB$logopt\fR\fB, \fR\f(CB$facility\fR\fB)\fR" 4
112 .IX Item "openlog($ident, $logopt, $facility)"
113 Opens the syslog.
114 \&\f(CW$ident\fR is prepended to every message. \f(CW$logopt\fR contains zero or
115 more of the options detailed below. \f(CW$facility\fR specifies the part
116 of the system to report about, for example \f(CW\*(C`LOG_USER\*(C'\fR or \f(CW\*(C`LOG_LOCAL0\*(C'\fR:
117 see "Facilities" for a list of well\-known facilities, and your
118 \&\f(CWsyslog(3)\fR documentation for the facilities available in your system.
119 Check "SEE ALSO" for useful links. Facility can be given as a string
120 or a numeric macro.
121 .Sp
122 This function will croak if it can\*(Aqt connect to the syslog daemon.
123 .Sp
124 Note that \f(CWopenlog()\fR now takes three arguments, just like \f(CWopenlog(3)\fR.
125 .Sp
126 \&\fBYou should use \fR\f(CBopenlog()\fR\fB before calling \fR\f(CBsyslog()\fR\fB.\fR
127 .Sp
128 \&\fBOptions\fR
129 .RS 4
130 .IP \(bu 4
131 \&\f(CW\*(C`cons\*(C'\fR \- This option is ignored, since the failover mechanism will drop
132 down to the console automatically if all other media fail.
133 .IP \(bu 4
134 \&\f(CW\*(C`ndelay\*(C'\fR \- Open the connection immediately (normally, the connection is
135 opened when the first message is logged).
136 .IP \(bu 4
137 \&\f(CW\*(C`noeol\*(C'\fR \- When set to true, no end of line character (\f(CW\*(C`\en\*(C'\fR) will be
138 appended to the message. This can be useful for some syslog daemons.
139 Added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.29.
140 .IP \(bu 4
141 \&\f(CW\*(C`nofatal\*(C'\fR \- When set to true, \f(CWopenlog()\fR and \f(CWsyslog()\fR will only
142 emit warnings instead of dying if the connection to the syslog can\*(Aqt
143 be established. Added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.15.
144 .IP \(bu 4
145 \&\f(CW\*(C`nonul\*(C'\fR \- When set to true, no \f(CW\*(C`NUL\*(C'\fR character (\f(CW\*(C`\e0\*(C'\fR) will be
146 appended to the message. This can be useful for some syslog daemons.
147 Added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.29.
148 .IP \(bu 4
149 \&\f(CW\*(C`nowait\*(C'\fR \- Don\*(Aqt wait for child processes that may have been created
150 while logging the message. (The GNU C library does not create a child
151 process, so this option has no effect on Linux.)
152 .IP \(bu 4
153 \&\f(CW\*(C`perror\*(C'\fR \- Write the message to standard error output as well to the
154 system log. Added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.22.
155 .IP \(bu 4
156 \&\f(CW\*(C`pid\*(C'\fR \- Include PID with each message.
157 .RE
158 .RS 4
159 .Sp
160 \&\fBExamples\fR
161 .Sp
162 Open the syslog with options \f(CW\*(C`ndelay\*(C'\fR and \f(CW\*(C`pid\*(C'\fR, and with facility \f(CW\*(C`LOCAL0\*(C'\fR:
163 .Sp
164 .Vb 1
165 \& openlog($name, "ndelay,pid", "local0");
166 .Ve
167 .Sp
168 Same thing, but this time using the macro corresponding to \f(CW\*(C`LOCAL0\*(C'\fR:
169 .Sp
170 .Vb 1
171 \& openlog($name, "ndelay,pid", LOG_LOCAL0);
172 .Ve
173 .RE
174 .ie n .IP "\fBsyslog($priority, \fR\fB$message\fR\fB)\fR" 4
175 .el .IP "\fBsyslog($priority, \fR\f(CB$message\fR\fB)\fR" 4
176 .IX Item "syslog($priority, $message)"
177 .PD 0
178 .ie n .IP "\fBsyslog($priority, \fR\fB$format\fR\fB, \fR\fB@args\fR\fB)\fR" 4
179 .el .IP "\fBsyslog($priority, \fR\f(CB$format\fR\fB, \fR\f(CB@args\fR\fB)\fR" 4
180 .IX Item "syslog($priority, $format, @args)"
181 .PD
182 If \f(CW$priority\fR permits, logs \f(CW$message\fR or \f(CW\*(C`sprintf($format, @args)\*(C'\fR
183 with the addition that \f(CW%m\fR in \f(CW$message\fR or \f(CW$format\fR is replaced with
184 \&\f(CW"$!"\fR (the latest error message).
185 .Sp
186 \&\f(CW$priority\fR can specify a level, or a level and a facility. Levels and
187 facilities can be given as strings or as macros. When using the \f(CW\*(C`eventlog\*(C'\fR
188 mechanism, priorities \f(CW\*(C`DEBUG\*(C'\fR and \f(CW\*(C`INFO\*(C'\fR are mapped to event type
189 \&\f(CW\*(C`informational\*(C'\fR, \f(CW\*(C`NOTICE\*(C'\fR and \f(CW\*(C`WARNING\*(C'\fR to \f(CW\*(C`warning\*(C'\fR and \f(CW\*(C`ERR\*(C'\fR to
190 \&\f(CW\*(C`EMERG\*(C'\fR to \f(CW\*(C`error\*(C'\fR.
191 .Sp
192 If you didn\*(Aqt use \f(CWopenlog()\fR before using \f(CWsyslog()\fR, \f(CWsyslog()\fR will
193 try to guess the \f(CW$ident\fR by extracting the shortest prefix of
194 \&\f(CW$format\fR that ends in a \f(CW":"\fR.
195 .Sp
196 \&\fBExamples\fR
197 .Sp
198 .Vb 3
199 \& # informational level
200 \& syslog("info", $message);
201 \& syslog(LOG_INFO, $message);
202 \&
203 \& # information level, Local0 facility
204 \& syslog("info|local0", $message);
205 \& syslog(LOG_INFO|LOG_LOCAL0, $message);
206 .Ve
207 .RS 4
208 .IP \fBNote\fR 4
209 .IX Item "Note"
210 \&\f(CW\*(C`Sys::Syslog\*(C'\fR version v0.07 and older passed the \f(CW$message\fR as the
211 formatting string to \f(CWsprintf()\fR even when no formatting arguments
212 were provided. If the code calling \f(CWsyslog()\fR might execute with
213 older versions of this module, make sure to call the function as
214 \&\f(CW\*(C`syslog($priority, "%s", $message)\*(C'\fR instead of \f(CW\*(C`syslog($priority,
215 $message)\*(C'\fR. This protects against hostile formatting sequences that
216 might show up if \f(CW$message\fR contains tainted data.
217 .RE
218 .RS 4
219 .RE
220 .IP \fBsetlogmask($mask_priority)\fR 4
221 .IX Item "setlogmask($mask_priority)"
222 Sets the log mask for the current process to \f(CW$mask_priority\fR and
223 returns the old mask. If the mask argument is 0, the current log mask
224 is not modified. See "Levels" for the list of available levels.
225 You can use the \f(CWLOG_UPTO()\fR function to allow all levels up to a
226 given priority (but it only accept the numeric macros as arguments).
227 .Sp
228 \&\fBExamples\fR
229 .Sp
230 Only log errors:
231 .Sp
232 .Vb 1
233 \& setlogmask( LOG_MASK(LOG_ERR) );
234 .Ve
235 .Sp
236 Log everything except informational messages:
237 .Sp
238 .Vb 1
239 \& setlogmask( ~(LOG_MASK(LOG_INFO)) );
240 .Ve
241 .Sp
242 Log critical messages, errors and warnings:
243 .Sp
244 .Vb 3
245 \& setlogmask( LOG_MASK(LOG_CRIT)
246 \& | LOG_MASK(LOG_ERR)
247 \& | LOG_MASK(LOG_WARNING) );
248 .Ve
249 .Sp
250 Log all messages up to debug:
251 .Sp
252 .Vb 1
253 \& setlogmask( LOG_UPTO(LOG_DEBUG) );
254 .Ve
255 .IP \fBsetlogsock()\fR 4
256 .IX Item "setlogsock()"
257 Sets the socket type and options to be used for the next call to \f(CWopenlog()\fR
258 or \f(CWsyslog()\fR. Returns true on success, \f(CW\*(C`undef\*(C'\fR on failure.
259 .Sp
260 Being Perl\-specific, this function has evolved along time. It can currently
261 be called as follow:
262 .RS 4
263 .IP \(bu 4
264 \&\f(CWsetlogsock($sock_type)\fR
265 .IP \(bu 4
266 \&\f(CW\*(C`setlogsock($sock_type, $stream_location)\*(C'\fR (added in Perl 5.004_02)
267 .IP \(bu 4
268 \&\f(CW\*(C`setlogsock($sock_type, $stream_location, $sock_timeout)\*(C'\fR (added in
269 \&\f(CW\*(C`Sys::Syslog\*(C'\fR 0.25)
270 .IP \(bu 4
271 \&\f(CWsetlogsock(\e%options)\fR (added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.28)
272 .RE
273 .RS 4
274 .Sp
275 The available options are:
276 .IP \(bu 4
277 \&\f(CW\*(C`type\*(C'\fR \- equivalent to \f(CW$sock_type\fR, selects the socket type (or
278 "mechanism"). An array reference can be passed to specify several
279 mechanisms to try, in the given order.
280 .IP \(bu 4
281 \&\f(CW\*(C`path\*(C'\fR \- equivalent to \f(CW$stream_location\fR, sets the stream location.
282 Defaults to standard Unix location, or \f(CW\*(C`_PATH_LOG\*(C'\fR.
283 .IP \(bu 4
284 \&\f(CW\*(C`timeout\*(C'\fR \- equivalent to \f(CW$sock_timeout\fR, sets the socket timeout
285 in seconds. Defaults to 0 on all systems except Mac\ OS\ X where it
286 is set to 0.25 sec.
287 .IP \(bu 4
288 \&\f(CW\*(C`host\*(C'\fR \- sets the hostname to send the messages to. Defaults to
289 the local host.
290 .IP \(bu 4
291 \&\f(CW\*(C`port\*(C'\fR \- sets the TCP or UDP port to connect to. Defaults to the
292 first standard syslog port available on the system.
293 .RE
294 .RS 4
295 .Sp
296 The available mechanisms are:
297 .IP \(bu 4
298 \&\f(CW"native"\fR \- use the native C functions from your \f(CWsyslog(3)\fR library
299 (added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.15).
300 .IP \(bu 4
301 \&\f(CW"eventlog"\fR \- send messages to the Win32 events logger (Win32 only;
302 added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.19).
303 .IP \(bu 4
304 \&\f(CW"tcp"\fR \- connect to a TCP socket, on the \f(CW\*(C`syslog/tcp\*(C'\fR or \f(CW\*(C`syslogng/tcp\*(C'\fR
305 service. See also the \f(CW\*(C`host\*(C'\fR, \f(CW\*(C`port\*(C'\fR and \f(CW\*(C`timeout\*(C'\fR options.
306 .IP \(bu 4
307 \&\f(CW"udp"\fR \- connect to a UDP socket, on the \f(CW\*(C`syslog/udp\*(C'\fR service.
308 See also the \f(CW\*(C`host\*(C'\fR, \f(CW\*(C`port\*(C'\fR and \f(CW\*(C`timeout\*(C'\fR options.
309 .IP \(bu 4
310 \&\f(CW"inet"\fR \- connect to an INET socket, either TCP or UDP, tried in that
311 order. See also the \f(CW\*(C`host\*(C'\fR, \f(CW\*(C`port\*(C'\fR and \f(CW\*(C`timeout\*(C'\fR options.
312 .IP \(bu 4
313 \&\f(CW"unix"\fR \- connect to a UNIX domain socket (in some systems a character
314 special device). The name of that socket is given by the \f(CW\*(C`path\*(C'\fR option
315 or, if omitted, the value returned by the \f(CW\*(C`_PATH_LOG\*(C'\fR macro (if your
316 system defines it), \fI/dev/log\fR or \fI/dev/conslog\fR, whichever is writable.
317 .IP \(bu 4
318 \&\f(CW"stream"\fR \- connect to the stream indicated by the \f(CW\*(C`path\*(C'\fR option, or,
319 if omitted, the value returned by the \f(CW\*(C`_PATH_LOG\*(C'\fR macro (if your system
320 defines it), \fI/dev/log\fR or \fI/dev/conslog\fR, whichever is writable. For
321 example Solaris and IRIX system may prefer \f(CW"stream"\fR instead of \f(CW"unix"\fR.
322 .IP \(bu 4
323 \&\f(CW"pipe"\fR \- connect to the named pipe indicated by the \f(CW\*(C`path\*(C'\fR option,
324 or, if omitted, to the value returned by the \f(CW\*(C`_PATH_LOG\*(C'\fR macro (if your
325 system defines it), or \fI/dev/log\fR (added in \f(CW\*(C`Sys::Syslog\*(C'\fR 0.21).
326 HP\-UX is a system which uses such a named pipe.
327 .IP \(bu 4
328 \&\f(CW"console"\fR \- send messages directly to the console, as for the \f(CW"cons"\fR
329 option of \f(CWopenlog()\fR.
330 .RE
331 .RS 4
332 .Sp
333 The default is to try \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`tcp\*(C'\fR, \f(CW\*(C`udp\*(C'\fR, \f(CW\*(C`unix\*(C'\fR, \f(CW\*(C`pipe\*(C'\fR, \f(CW\*(C`stream\*(C'\fR,
334 \&\f(CW\*(C`console\*(C'\fR.
335 Under systems with the Win32 API, \f(CW\*(C`eventlog\*(C'\fR will be added as the first
336 mechanism to try if \f(CW\*(C`Win32::EventLog\*(C'\fR is available.
337 .Sp
338 Giving an invalid value for \f(CW$sock_type\fR will \f(CW\*(C`croak\*(C'\fR.
339 .Sp
340 \&\fBExamples\fR
341 .Sp
342 Select the UDP socket mechanism:
343 .Sp
344 .Vb 1
345 \& setlogsock("udp");
346 .Ve
347 .Sp
348 Send messages using the TCP socket mechanism on a custom port:
349 .Sp
350 .Vb 1
351 \& setlogsock({ type => "tcp", port => 2486 });
352 .Ve
353 .Sp
354 Send messages to a remote host using the TCP socket mechanism:
355 .Sp
356 .Vb 1
357 \& setlogsock({ type => "tcp", host => $loghost });
358 .Ve
359 .Sp
360 Try the native, UDP socket then UNIX domain socket mechanisms:
361 .Sp
362 .Vb 1
363 \& setlogsock(["native", "udp", "unix"]);
364 .Ve
365 .IP \fBNote\fR 4
366 .IX Item "Note"
367 Now that the "native" mechanism is supported by \f(CW\*(C`Sys::Syslog\*(C'\fR and selected
368 by default, the use of the \f(CWsetlogsock()\fR function is discouraged because
369 other mechanisms are less portable across operating systems. Authors of
370 modules and programs that use this function, especially its cargo\-cult form
371 \&\f(CWsetlogsock("unix")\fR, are advised to remove any occurrence of it unless they
372 specifically want to use a given mechanism (like TCP or UDP to connect to
373 a remote host).
374 .RE
375 .RS 4
376 .RE
377 .IP \fBcloselog()\fR 4
378 .IX Item "closelog()"
379 Closes the log file and returns true on success.
380 .SH "THE RULES OF SYS::SYSLOG"
381 .IX Header "THE RULES OF SYS::SYSLOG"
382 \&\fIThe First Rule of Sys::Syslog is:\fR
383 You do not call \f(CW\*(C`setlogsock\*(C'\fR.
384 .PP
385 \&\fIThe Second Rule of Sys::Syslog is:\fR
386 You \fBdo not\fR call \f(CW\*(C`setlogsock\*(C'\fR.
387 .PP
388 \&\fIThe Third Rule of Sys::Syslog is:\fR
389 The program crashes, \f(CW\*(C`die\*(C'\fRs, calls \f(CW\*(C`closelog\*(C'\fR, the log is over.
390 .PP
391 \&\fIThe Fourth Rule of Sys::Syslog is:\fR
392 One facility, one priority.
393 .PP
394 \&\fIThe Fifth Rule of Sys::Syslog is:\fR
395 One log at a time.
396 .PP
397 \&\fIThe Sixth Rule of Sys::Syslog is:\fR
398 No \f(CW\*(C`syslog\*(C'\fR before \f(CW\*(C`openlog\*(C'\fR.
399 .PP
400 \&\fIThe Seventh Rule of Sys::Syslog is:\fR
401 Logs will go on as long as they have to.
402 .PP
403 \&\fIThe Eighth, and Final Rule of Sys::Syslog is:\fR
404 If this is your first use of Sys::Syslog, you must read the doc.
405 .SH EXAMPLES
406 .IX Header "EXAMPLES"
407 An example:
408 .PP
409 .Vb 4
410 \& openlog($program, \*(Aqcons,pid\*(Aq, \*(Aquser\*(Aq);
411 \& syslog(\*(Aqinfo\*(Aq, \*(Aq%s\*(Aq, \*(Aqthis is another test\*(Aq);
412 \& syslog(\*(Aqmail|warning\*(Aq, \*(Aqthis is a better test: %d\*(Aq, time);
413 \& closelog();
414 \&
415 \& syslog(\*(Aqdebug\*(Aq, \*(Aqthis is the last test\*(Aq);
416 .Ve
417 .PP
418 Another example:
419 .PP
420 .Vb 2
421 \& openlog("$program $$", \*(Aqndelay\*(Aq, \*(Aquser\*(Aq);
422 \& syslog(\*(Aqnotice\*(Aq, \*(Aqfooprogram: this is really done\*(Aq);
423 .Ve
424 .PP
425 Example of use of \f(CW%m\fR:
426 .PP
427 .Vb 2
428 \& $! = 55;
429 \& syslog(\*(Aqinfo\*(Aq, \*(Aqproblem was %m\*(Aq); # %m == $! in syslog(3)
430 .Ve
431 .PP
432 Log to UDP port on \f(CW$remotehost\fR instead of logging locally:
433 .PP
434 .Vb 3
435 \& setlogsock("udp", $remotehost);
436 \& openlog($program, \*(Aqndelay\*(Aq, \*(Aquser\*(Aq);
437 \& syslog(\*(Aqinfo\*(Aq, \*(Aqsomething happened over here\*(Aq);
438 .Ve
439 .SH CONSTANTS
440 .IX Header "CONSTANTS"
441 .SS Facilities
442 .IX Subsection "Facilities"
443 .IP \(bu 4
444 \&\f(CW\*(C`LOG_AUDIT\*(C'\fR \- audit daemon (IRIX); falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR
445 .IP \(bu 4
446 \&\f(CW\*(C`LOG_AUTH\*(C'\fR \- security/authorization messages
447 .IP \(bu 4
448 \&\f(CW\*(C`LOG_AUTHPRIV\*(C'\fR \- security/authorization messages (private)
449 .IP \(bu 4
450 \&\f(CW\*(C`LOG_CONSOLE\*(C'\fR \- \f(CW\*(C`/dev/console\*(C'\fR output (FreeBSD); falls back to \f(CW\*(C`LOG_USER\*(C'\fR
451 .IP \(bu 4
452 \&\f(CW\*(C`LOG_CRON\*(C'\fR \- clock daemons (\fBcron\fR and \fBat\fR)
453 .IP \(bu 4
454 \&\f(CW\*(C`LOG_DAEMON\*(C'\fR \- system daemons without separate facility value
455 .IP \(bu 4
456 \&\f(CW\*(C`LOG_FTP\*(C'\fR \- FTP daemon
457 .IP \(bu 4
458 \&\f(CW\*(C`LOG_KERN\*(C'\fR \- kernel messages
459 .IP \(bu 4
460 \&\f(CW\*(C`LOG_INSTALL\*(C'\fR \- installer subsystem (Mac OS X); falls back to \f(CW\*(C`LOG_USER\*(C'\fR
461 .IP \(bu 4
462 \&\f(CW\*(C`LOG_LAUNCHD\*(C'\fR \- launchd \- general bootstrap daemon (Mac OS X);
463 falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR
464 .IP \(bu 4
465 \&\f(CW\*(C`LOG_LFMT\*(C'\fR \- logalert facility; falls back to \f(CW\*(C`LOG_USER\*(C'\fR
466 .IP \(bu 4
467 \&\f(CW\*(C`LOG_LOCAL0\*(C'\fR through \f(CW\*(C`LOG_LOCAL7\*(C'\fR \- reserved for local use
468 .IP \(bu 4
469 \&\f(CW\*(C`LOG_LPR\*(C'\fR \- line printer subsystem
470 .IP \(bu 4
471 \&\f(CW\*(C`LOG_MAIL\*(C'\fR \- mail subsystem
472 .IP \(bu 4
473 \&\f(CW\*(C`LOG_NETINFO\*(C'\fR \- NetInfo subsystem (Mac OS X); falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR
474 .IP \(bu 4
475 \&\f(CW\*(C`LOG_NEWS\*(C'\fR \- USENET news subsystem
476 .IP \(bu 4
477 \&\f(CW\*(C`LOG_NTP\*(C'\fR \- NTP subsystem (FreeBSD, NetBSD); falls back to \f(CW\*(C`LOG_DAEMON\*(C'\fR
478 .IP \(bu 4
479 \&\f(CW\*(C`LOG_RAS\*(C'\fR \- Remote Access Service (VPN / PPP) (Mac OS X);
480 falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR
481 .IP \(bu 4
482 \&\f(CW\*(C`LOG_REMOTEAUTH\*(C'\fR \- remote authentication/authorization (Mac OS X);
483 falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR
484 .IP \(bu 4
485 \&\f(CW\*(C`LOG_SECURITY\*(C'\fR \- security subsystems (firewalling, etc.) (FreeBSD);
486 falls back to \f(CW\*(C`LOG_AUTH\*(C'\fR
487 .IP \(bu 4
488 \&\f(CW\*(C`LOG_SYSLOG\*(C'\fR \- messages generated internally by \fBsyslogd\fR
489 .IP \(bu 4
490 \&\f(CW\*(C`LOG_USER\*(C'\fR (default) \- generic user\-level messages
491 .IP \(bu 4
492 \&\f(CW\*(C`LOG_UUCP\*(C'\fR \- UUCP subsystem
493 .SS Levels
494 .IX Subsection "Levels"
495 .IP \(bu 4
496 \&\f(CW\*(C`LOG_EMERG\*(C'\fR \- system is unusable
497 .IP \(bu 4
498 \&\f(CW\*(C`LOG_ALERT\*(C'\fR \- action must be taken immediately
499 .IP \(bu 4
500 \&\f(CW\*(C`LOG_CRIT\*(C'\fR \- critical conditions
501 .IP \(bu 4
502 \&\f(CW\*(C`LOG_ERR\*(C'\fR \- error conditions
503 .IP \(bu 4
504 \&\f(CW\*(C`LOG_WARNING\*(C'\fR \- warning conditions
505 .IP \(bu 4
506 \&\f(CW\*(C`LOG_NOTICE\*(C'\fR \- normal, but significant, condition
507 .IP \(bu 4
508 \&\f(CW\*(C`LOG_INFO\*(C'\fR \- informational message
509 .IP \(bu 4
510 \&\f(CW\*(C`LOG_DEBUG\*(C'\fR \- debug\-level message
511 .SH DIAGNOSTICS
512 .IX Header "DIAGNOSTICS"
513 .ie n .IP """Invalid argument passed to setlogsock""" 4
514 .el .IP "\f(CWInvalid argument passed to setlogsock\fR" 4
515 .IX Item "Invalid argument passed to setlogsock"
516 \&\fB(F)\fR You gave \f(CWsetlogsock()\fR an invalid value for \f(CW$sock_type\fR.
517 .ie n .IP """eventlog passed to setlogsock, but no Win32 API available""" 4
518 .el .IP "\f(CWeventlog passed to setlogsock, but no Win32 API available\fR" 4
519 .IX Item "eventlog passed to setlogsock, but no Win32 API available"
520 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use the Win32 event logger but the
521 operating system running the program isn\*(Aqt Win32 or does not provides Win32
522 compatible facilities.
523 .ie n .IP """no connection to syslog available""" 4
524 .el .IP "\f(CWno connection to syslog available\fR" 4
525 .IX Item "no connection to syslog available"
526 \&\fB(F)\fR \f(CWsyslog()\fR failed to connect to the specified socket.
527 .ie n .IP """stream passed to setlogsock, but %s is not writable""" 4
528 .el .IP "\f(CWstream passed to setlogsock, but %s is not writable\fR" 4
529 .IX Item "stream passed to setlogsock, but %s is not writable"
530 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use a stream socket, but the given
531 path is not writable.
532 .ie n .IP """stream passed to setlogsock, but could not find any device""" 4
533 .el .IP "\f(CWstream passed to setlogsock, but could not find any device\fR" 4
534 .IX Item "stream passed to setlogsock, but could not find any device"
535 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use a stream socket, but didn\*(Aqt
536 provide a path, and \f(CW\*(C`Sys::Syslog\*(C'\fR was unable to find an appropriate one.
537 .ie n .IP """tcp passed to setlogsock, but tcp service unavailable""" 4
538 .el .IP "\f(CWtcp passed to setlogsock, but tcp service unavailable\fR" 4
539 .IX Item "tcp passed to setlogsock, but tcp service unavailable"
540 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use a TCP socket, but the service
541 is not available on the system.
542 .ie n .IP """syslog: expecting argument %s""" 4
543 .el .IP "\f(CWsyslog: expecting argument %s\fR" 4
544 .IX Item "syslog: expecting argument %s"
545 \&\fB(F)\fR You forgot to give \f(CWsyslog()\fR the indicated argument.
546 .ie n .IP """syslog: invalid level/facility: %s""" 4
547 .el .IP "\f(CWsyslog: invalid level/facility: %s\fR" 4
548 .IX Item "syslog: invalid level/facility: %s"
549 \&\fB(F)\fR You specified an invalid level or facility.
550 .ie n .IP """syslog: too many levels given: %s""" 4
551 .el .IP "\f(CWsyslog: too many levels given: %s\fR" 4
552 .IX Item "syslog: too many levels given: %s"
553 \&\fB(F)\fR You specified too many levels.
554 .ie n .IP """syslog: too many facilities given: %s""" 4
555 .el .IP "\f(CWsyslog: too many facilities given: %s\fR" 4
556 .IX Item "syslog: too many facilities given: %s"
557 \&\fB(F)\fR You specified too many facilities.
558 .ie n .IP """syslog: level must be given""" 4
559 .el .IP "\f(CWsyslog: level must be given\fR" 4
560 .IX Item "syslog: level must be given"
561 \&\fB(F)\fR You forgot to specify a level.
562 .ie n .IP """udp passed to setlogsock, but udp service unavailable""" 4
563 .el .IP "\f(CWudp passed to setlogsock, but udp service unavailable\fR" 4
564 .IX Item "udp passed to setlogsock, but udp service unavailable"
565 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use a UDP socket, but the service
566 is not available on the system.
567 .ie n .IP """unix passed to setlogsock, but path not available""" 4
568 .el .IP "\f(CWunix passed to setlogsock, but path not available\fR" 4
569 .IX Item "unix passed to setlogsock, but path not available"
570 \&\fB(W)\fR You asked \f(CWsetlogsock()\fR to use a UNIX socket, but \f(CW\*(C`Sys::Syslog\*(C'\fR
571 was unable to find an appropriate an appropriate device.
572 .SH HISTORY
573 .IX Header "HISTORY"
574 \&\f(CW\*(C`Sys::Syslog\*(C'\fR is a core module, part of the standard Perl distribution
575 since 1990. At this time, modules as we know them didn\*(Aqt exist, the
576 Perl library was a collection of \fI.pl\fR files, and the one for sending
577 syslog messages with was simply \fIlib/syslog.pl\fR, included with Perl 3.0.
578 It was converted as a module with Perl 5.0, but had a version number
579 only starting with Perl 5.6. Here is a small table with the matching
580 Perl and \f(CW\*(C`Sys::Syslog\*(C'\fR versions.
581 .PP
582 .Vb 10
583 \& Sys::Syslog Perl
584 \& \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-
585 \& undef 5.0.0 ~ 5.5.4
586 \& 0.01 5.6.*
587 \& 0.03 5.8.0
588 \& 0.04 5.8.1, 5.8.2, 5.8.3
589 \& 0.05 5.8.4, 5.8.5, 5.8.6
590 \& 0.06 5.8.7
591 \& 0.13 5.8.8
592 \& 0.22 5.10.0
593 \& 0.27 5.8.9, 5.10.1 ~ 5.14.*
594 \& 0.29 5.16.*
595 \& 0.32 5.18.*
596 \& 0.33 5.20.*
597 \& 0.33 5.22.*
598 .Ve
599 .SH "SEE ALSO"
600 .IX Header "SEE ALSO"
601 .SS "Other modules"
602 .IX Subsection "Other modules"
603 Log::Log4perl \- Perl implementation of the Log4j API
604 .PP
605 Log::Dispatch \- Dispatches messages to one or more outputs
606 .PP
607 Log::Report \- Report a problem, with exceptions and language support
608 .SS "Manual Pages"
609 .IX Subsection "Manual Pages"
610 \&\fBsyslog\fR\|(3)
611 .PP
612 SUSv3 issue 6, IEEE Std 1003.1, 2004 edition,
613 <http://www.opengroup.org/onlinepubs/000095399/basedefs/syslog.h.html>
614 .PP
615 GNU C Library documentation on syslog,
616 <http://www.gnu.org/software/libc/manual/html_node/Syslog.html>
617 .PP
618 FreeBSD documentation on syslog,
619 <https://www.freebsd.org/cgi/man.cgi?query=syslog>
620 .PP
621 Solaris 11 documentation on syslog,
622 <https://docs.oracle.com/cd/E53394_01/html/E54766/syslog\-3c.html>
623 .PP
624 Mac OS X documentation on syslog,
625 <http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/syslog.3.html>
626 .PP
627 IRIX documentation on syslog,
628 <http://nixdoc.net/man\-pages/IRIX/man3/syslog.3c.html>
629 .PP
630 AIX 5L 5.3 documentation on syslog,
631 <http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf2/syslog.htm>
632 .PP
633 HP\-UX 11i documentation on syslog,
634 <http://docs.hp.com/en/B2355\-60130/syslog.3C.html>
635 .PP
636 Tru64 documentation on syslog,
637 <http://nixdoc.net/man\-pages/Tru64/man3/syslog.3.html>
638 .PP
639 Stratus VOS 15.1,
640 <http://stratadoc.stratus.com/vos/15.1.1/r502\-01/wwhelp/wwhimpl/js/html/wwhelp.htm?context=r502\-01&file=ch5r502\-01bi.html>
641 .SS RFCs
642 .IX Subsection "RFCs"
643 \&\fIRFC 3164 \- The BSD syslog Protocol\fR, <http://www.faqs.org/rfcs/rfc3164.html>
644 \&\-\- Please note that this is an informational RFC, and therefore does not
645 specify a standard of any kind.
646 .PP
647 \&\fIRFC 3195 \- Reliable Delivery for syslog\fR, <http://www.faqs.org/rfcs/rfc3195.html>
648 .SS Articles
649 .IX Subsection "Articles"
650 \&\fISyslogging with Perl\fR, <http://lexington.pm.org/meetings/022001.html>
651 .SS "Event Log"
652 .IX Subsection "Event Log"
653 Windows Event Log,
654 <http://msdn.microsoft.com/library/default.asp?url=/library/en\-us/wes/wes/windows_event_log.asp>
655 .SH "AUTHORS & ACKNOWLEDGEMENTS"
656 .IX Header "AUTHORS & ACKNOWLEDGEMENTS"
657 Tom Christiansen <\fItchrist (at) perl.com\fR> and Larry Wall
658 <\fIlarry (at) wall.org\fR>.
659 .PP
660 UNIX domain sockets added by Sean Robinson
661 <\fIrobinson_s (at) sc.maricopa.edu\fR> with support from Tim Bunce
662 <\fITim.Bunce (at) ig.co.uk\fR> and the \f(CW\*(C`perl5\-porters\*(C'\fR mailing list.
663 .PP
664 Dependency on \fIsyslog.ph\fR replaced with XS code by Tom Hughes
665 <\fItom (at) compton.nu\fR>.
666 .PP
667 Code for \f(CWconstant()\fRs regenerated by Nicholas Clark <\fInick (at) ccl4.org\fR>.
668 .PP
669 Failover to different communication modes by Nick Williams
670 <\fINick.Williams (at) morganstanley.com\fR>.
671 .PP
672 Extracted from core distribution for publishing on the CPAN by
673 Sébastien Aperghis\-Tramoni <sebastien (at) aperghis.net>.
674 .PP
675 XS code for using native C functions borrowed from \f(CW\*(C`Unix::Syslog\*(C'\fR,
676 written by Marcus Harnisch <\fImarcus.harnisch (at) gmx.net\fR>.
677 .PP
678 Yves Orton suggested and helped for making \f(CW\*(C`Sys::Syslog\*(C'\fR use the native
679 event logger under Win32 systems.
680 .PP
681 Jerry D. Hedden and Reini Urban provided greatly appreciated help to
682 debug and polish \f(CW\*(C`Sys::Syslog\*(C'\fR under Cygwin.
683 .SH BUGS
684 .IX Header "BUGS"
685 Please report any bugs or feature requests to
686 \&\f(CW\*(C`bug\-sys\-syslog (at) rt.cpan.org\*(C'\fR, or through the web interface at
687 <http://rt.cpan.org/Public/Dist/Display.html?Name=Sys\-Syslog>.
688 I will be notified, and then you\*(Aqll automatically be notified of progress on
689 your bug as I make changes.
690 .SH SUPPORT
691 .IX Header "SUPPORT"
692 You can find documentation for this module with the perldoc command.
693 .PP
694 .Vb 1
695 \& perldoc Sys::Syslog
696 .Ve
697 .PP
698 You can also look for information at:
699 .IP \(bu 4
700 Perl Documentation
701 .Sp
702 <http://perldoc.perl.org/Sys/Syslog.html>
703 .IP \(bu 4
704 MetaCPAN
705 .Sp
706 <https://metacpan.org/module/Sys::Syslog>
707 .IP \(bu 4
708 Search CPAN
709 .Sp
710 <http://search.cpan.org/dist/Sys\-Syslog/>
711 .IP \(bu 4
712 AnnoCPAN: Annotated CPAN documentation
713 .Sp
714 <http://annocpan.org/dist/Sys\-Syslog>
715 .IP \(bu 4
716 CPAN Ratings
717 .Sp
718 <http://cpanratings.perl.org/d/Sys\-Syslog>
719 .IP \(bu 4
720 RT: CPAN\*(Aqs request tracker
721 .Sp
722 <http://rt.cpan.org/Dist/Display.html?Queue=Sys\-Syslog>
723 .PP
724 The source code is available on Git Hub:
725 <https://github.com/maddingue/Sys\-Syslog/>
726 .SH COPYRIGHT
727 .IX Header "COPYRIGHT"
728 Copyright (C) 1990\-2012 by Larry Wall and others.
729 .SH LICENSE
730 .IX Header "LICENSE"
731 This program is free software; you can redistribute it and/or modify it
732 under the same terms as Perl itself.