Subject: | add TIMESTAMP |
I want logging not timestamp of receiving syslogd but timestamp of do syslog().
Please add timestamp before syslog_send().
--- Syslog.pm.orig 2005-12-08 10:03:17.000000000 +0900
+++ Syslog.pm 2005-12-19 21:10:15.000000000 +0900
@@ -25,6 +25,7 @@
use Socket ':all';
use Sys::Hostname;
+use POSIX qw(strftime locale_h);
=head1 NAME
@@ -569,7 +570,11 @@
$message = @_ ? sprintf($mask, @_) : $mask;
$sum = $numpri + $numfac;
- my $buf = "<$sum>$whoami: $message\0";
+ my $oldlocale = setlocale(LC_TIME);
+ setlocale(LC_TIME, 'C');
+ my $timestamp = strftime "%b %e %T", localtime;
+ setlocale(LC_TIME, $oldlocale);
+ my $buf = "<$sum>$timestamp $whoami: $message\0";
# it's possible that we'll get an error from sending
# (e.g. if method is UDP and there is no UDP listener,