NAME

Log::Log4perl::Appender::Journald - Journald appender for Log4perl

SYNOPSIS

use Log::Log4perl;

my $log4perl_conf = <<EOC;
log4perl.rootLogger = DEBUG, Journal
log4perl.appender.Journal = Log::Log4perl::Appender::Journald
log4perl.appender.Journal.layout = Log::Log4perl::Layout::NoopLayout
log4perl.appender.Journal.ifundef = "<not set>"
EOC

Log::Log4perl->init(\$log4perl_conf);
Log::Log4perl::MDC->put(HELLO => 'World');
my $logger = Log::Log4perl->get_logger('log4perl.rootLogger');
$logger->info("Time to die.");
$logger->error("Time to err.");

DESCRIPTION

This module provides a Log::Log4Perl appender that directs log messages to systemd-journald.service(8) via Log::Journald. It makes use of the structured logging capability, appending Log4perl MDCs with each message.

OPTIONS

ifundef

MDC items having an undef value are not logged by default. If you want to see undef values in the log provide a string to be used.

SEE ALSO

COPYRIGHT

Copyright 2014 Lubomir Rintel

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Lubomir Rintel, <lkundrak@v3.sk> Oliver Welter , <owelter@whiterabbitsecurity.com>

The code is hosted on GitHub http://github.com/lkundrak/perl-Log-Journald. Bug fixes and feature enhancements are always welcome.