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;
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
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.