From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Fri, 5 Sep 2003 20:34:15 +0000 (+0000)
Subject: Musty corners of Syslog.pm.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d256c0f6af54af3995fa6abb8d11a7c054803e3;p=p5sagit%2Fp5-mst-13.2.git

Musty corners of Syslog.pm.

p4raw-id: //depot/perl@21052
---

diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index 03adde6..a63c8bc 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.