is is a graylog logging radio through a redis database
use Moo 2;
use Redis 1.980;
use JSON 2.90 qw(encode_json);
use Time::HiRes 1.9726;
use Sys::Hostname ;
use Carp qw(croak carp);
use Scalar::Util
lf{timestamp} //= Time::HiRes::time();
# graylog seems to have problems with float values in json
# so force string, which works fine
$gelf{timestamp} = ''.$gelf{timestamp};
$gelf{sh
}
sub push {
my ($self, $gelf) = @_;
if (ref $gelf eq 'HASH') {
$gelf = encode_json($gelf);
}
$self->redis->lpush($self->queue, $gelf);
}
1;
__END__
=pod
=head1 NAME
Lo