diff options
Diffstat (limited to 'ext/Sys')
-rw-r--r-- | ext/Sys/Syslog/Syslog.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 03adde6363..a63c8bc3ce 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -36,7 +36,7 @@ Sys::Syslog, openlog, closelog, setlogmask, syslog - Perl interface to the UNIX use Sys::Syslog qw(:DEFAULT setlogsock); # default set, plus setlogsock setlogsock $sock_type; - openlog $ident, $logopt, $facility; + openlog $ident, $logopt, $facility; # don't forget this syslog $priority, $format, @args; $oldmask = setlogmask $mask_priority; closelog; @@ -57,7 +57,11 @@ I<$ident> is prepended to every message. I<$logopt> contains zero or more of the words I<pid>, I<ndelay>, I<nowait>. The cons option is ignored, since the failover mechanism will drop down to the console automatically if all other media fail. I<$facility> specifies the -part of the system +part of the system to report about, for example LOG_USER or LOG_LOCAL0: +see your C<syslog(3)> documentation for the facilities available in +your system. + +B<You should use openlog() before calling syslog().> =item syslog $priority, $format, @args @@ -65,6 +69,10 @@ If I<$priority> permits, logs I<($format, @args)> printed as by C<printf(3V)>, with the addition that I<%m> is replaced with C<"$!"> (the latest error message). +If you didn't use openlog() before using syslog(), syslog will try to +guess the I<$ident> by extracting the shortest prefix of I<$format> +that ends in a ":". + =item setlogmask $mask_priority Sets log mask I<$mask_priority> and returns the old mask. |