Plack::Util::Accessor qw(logger callback extra_field);
use Net::Domain qw(hostname hostfqdn);
use JSON;
sub new {
my ($class, $arg_ref) = @_;
my $self = $class->next::method($arg_ref);
if (defin
ogger = $self->logger() || sub { $env->{'psgi.errors'}->print($_[0] . "\n") };
$logger->(encode_json($log_entry));
return;
});
}
# Taken from Plack::Middleware::AccessLog
sub _safe {
my ($str
e example is used with a basic L<PSGI|PSGI> application that simply
returns C<ok>, the following, JSON-encoded message would be logged (on one log
line):
{
"remote_addr": "127.0.0.1",
"request_m