'Sys::Syslog' => {
'MAINTAINER' => 'saper',
- 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.32.tar.gz',
+ 'DISTRIBUTION' => 'SAPER/Sys-Syslog-0.33.tar.gz',
'FILES' => q[cpan/Sys-Syslog],
'EXCLUDED' => [
qr{^eg/},
Revision history for Sys-Syslog
+0.33 -- 2013.05.24 -- Sebastien Aperghis-Tramoni (SAPER)
+ [BUGFIX] CPAN-RT#82531: Invalid usage of POSIX::_exit (Alexander Berger).
+ [OPTIM] No longer inherit from Exporter.
+ [OPTIM] Load Fcntl only when necessary.
+ [DOC] Add links to other logging modules.
+ [DOC] CPAN-RT#80398: Typo spotted by alfirth@gmail.com
+ [DOC] Typo spotted by David Steinbrunner.
+ [TEST] CPAN-RT#79683: Added delays in t/facilities-routing.t
+
0.32 -- 2012.09.14 -- Sebastien Aperghis-Tramoni (SAPER)
[BUGFIX] CPAN-RT#69040: Don't modify @_ in syslog().
[BUGFIX] Restore compatibility with Perl 5.6.0.
use warnings;
use warnings::register;
use Carp;
-use Exporter ();
-use Fcntl qw< O_WRONLY >;
+use Exporter qw< import >;
use File::Basename;
use POSIX qw< strftime setlocale LC_TIME >;
use Socket qw< :all >;
{ no strict 'vars';
- $VERSION = '0.32';
- @ISA = qw< Exporter >;
+ $VERSION = '0.33';
%EXPORT_TAGS = (
standard => [qw(openlog syslog closelog setlogmask)],
} else {
if (open(CONS, ">/dev/console")) {
my $ret = print CONS $buf . "\r"; # XXX: should this be \x0A ?
- POSIX::_exit $ret if defined $pid;
+ POSIX::_exit($ret) if defined $pid;
close CONS;
}
- POSIX::_exit if defined $pid;
+ POSIX::_exit(0) if defined $pid;
}
}
# might want syslog_path to be variable based on syslog.h (if only
# it were in there!)
$syslog_path = '/dev/conslog' unless defined $syslog_path;
+
if (!-w $syslog_path) {
push @$errs, "stream $syslog_path is not writable";
return 0;
}
- if (!sysopen(SYSLOG, $syslog_path, O_WRONLY, 0400)) {
+
+ require Fcntl;
+
+ if (!sysopen(SYSLOG, $syslog_path, Fcntl::O_WRONLY(), 0400)) {
push @$errs, "stream can't open $syslog_path: $!";
return 0;
}
+
$syslog_send = \&_syslog_send_stream;
+
return 1;
}
=head1 VERSION
-This is the documentation of version 0.32
+This is the documentation of version 0.33
=head1 SYNOPSIS
=item *
C<perror> - Write the message to standard error output as well to the
-system log (added in C<Sys::Syslo> 0.22).
+system log (added in C<Sys::Syslog> 0.22).
=item *
by default, the use of the C<setlogsock()> function is discouraged because
other mechanisms are less portable across operating systems. Authors of
modules and programs that use this function, especially its cargo-cult form
-C<setlogsock("unix")>, are advised to remove any occurence of it unless they
+C<setlogsock("unix")>, are advised to remove any occurrence of it unless they
specifically want to use a given mechanism (like TCP or UDP to connect to
a remote host).
=head1 SEE ALSO
+=head2 Other modules
+
+L<Log::Log4perl> - Perl implementation of the Log4j API
+
+L<Log::Dispatch> - Dispatches messages to one or more outputs
+
+L<Log::Report> - Report a problem, with exceptions and language support
+
=head2 Manual Pages
L<syslog(3)>
POE::Kernel->run;
# check if some messages are missing
- my @miss = grep { $received{$_} < 2 } keys %received;
+ my @miss = sort grep { $received{$_} < 2 } keys %received;
diag "@miss" if @miss;
}
else {
# child: send messages to the syslog server
sleep 2;
+ my $delay = .01;
setlogsock({ host => $host, type => $proto, port => $port });
# first way, set the facility each time with openlog()
for my $level (@levels) {
eval { syslog($level => "<$facility\:$level>") }
or warn "error: syslog($level => '<$facility\:$level>'): $@";
+ select undef, undef, undef, $delay;
}
}
for my $level (@levels) {
eval { syslog("$facility.$level" => "<$facility\:$level>") }
or warn "error: syslog('$facility.$level' => '<$facility\:$level>'): $@";
+ select undef, undef, undef, $delay;
}
}
C<Sys::Syslog> therefore it's API may change at any time and no warranty is
made with regards to backward compatibility. You Have Been Warned.
+In order to execute this script and compile the Win32 support files, you
+need some helper programs: mc.exe, rc.exe and link.exe
+
+mc.exe and rc.exe can be downloaded from
+http://www.microsoft.com/en-us/download/details.aspx?id=11310
+
+link.exe is usually shipped with Visual Studio.
+
=head1 SEE ALSO
L<Sys::Syslog>