update patch to support microseconds on timestamp

This commit is contained in:
Mario Fetka 2018-03-28 14:58:51 +02:00
parent 05e277c3d3
commit f05f29903c

View File

@ -1,7 +1,25 @@
diff -uNr Log-Log4perl-Appender-Graylog-1.7.orig/lib/Data/DTO/GELF.pm Log-Log4perl-Appender-Graylog-1.7/lib/Data/DTO/GELF.pm
--- Log-Log4perl-Appender-Graylog-1.7.orig/lib/Data/DTO/GELF.pm 2018-03-28 14:15:13.708000000 +0200
+++ Log-Log4perl-Appender-Graylog-1.7/lib/Data/DTO/GELF.pm 2018-03-28 14:13:30.000000000 +0200
@@ -61,12 +61,27 @@
+++ Log-Log4perl-Appender-Graylog-1.7/lib/Data/DTO/GELF.pm 2018-03-28 14:57:01.000000000 +0200
@@ -13,6 +13,7 @@
use Sys::Hostname;
use Data::UUID;
use POSIX qw(strftime);
+use Time::HiRes;
use Log::Log4perl;
@@ -47,7 +48,8 @@
has 'timestamp' => (
is => 'ro',
- isa => 'Int',
+ #isa => 'Int',
+ isa => 'Num',
builder => '_build_timestamp',
);
@@ -61,12 +63,27 @@
isa => 'Str',
);
@ -31,7 +49,7 @@ diff -uNr Log-Log4perl-Appender-Graylog-1.7.orig/lib/Data/DTO/GELF.pm Log-Log4pe
is => 'rw',
isa => 'Str',
);
@@ -83,13 +98,20 @@
@@ -83,13 +100,20 @@
}
my $trace = Devel::StackTrace->new;
@ -55,9 +73,18 @@ diff -uNr Log-Log4perl-Appender-Graylog-1.7.orig/lib/Data/DTO/GELF.pm Log-Log4pe
}
@@ -105,7 +129,7 @@
sub _build_timestamp {
my $self = shift;
- return time();
+ return Time::HiRes::time();
}
sub message {
diff -uNr Log-Log4perl-Appender-Graylog-1.7.orig/lib/Log/Log4perl/Appender/Graylog.pm Log-Log4perl-Appender-Graylog-1.7/lib/Log/Log4perl/Appender/Graylog.pm
--- Log-Log4perl-Appender-Graylog-1.7.orig/lib/Log/Log4perl/Appender/Graylog.pm 2018-03-28 14:15:13.708000000 +0200
+++ Log-Log4perl-Appender-Graylog-1.7/lib/Log/Log4perl/Appender/Graylog.pm 2018-03-28 14:13:30.000000000 +0200
+++ Log-Log4perl-Appender-Graylog-1.7/lib/Log/Log4perl/Appender/Graylog.pm 2018-03-28 14:57:01.000000000 +0200
@@ -70,7 +70,8 @@
'_name' => $params{name},
'_category' => $params{log4p_category},