Log::Log4perl::Layout::Syslog - Layout in Syslog format
This format is useful with the Log::Dispatch::Syslog class. Add this to your configuration file:
log4perl.appender.A1=Log::Dispatch::Syslog log4perl.appender.A1.Filter=RangeAll log4perl.appender.A1.ident=bandsman log4perl.appender.A1.layout=Log::Log4perl::Layout::Syslog
Much of the actual formatting is done by the Sys::Syslog code called from Log::Dispatch::Syslog, however you can't use Log::Log4perl::Layout::NoopLayout since that doesn't insert the ident data that's needed by systems such as flutentd.
use Log::Log4perl::Layout::Syslog; my $layout = Log::Log4perl::Layout::Syslog->new();
Render a message in the correct format.
<njh at bandsman.co.uk>
I can't work out how to get the ident given to Log::Dispatch::Syslog's constructor, so ident (facility in RFC3164 lingo) is always sent to LOG_USER.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Copyright 2017 Nigel Horne.
This program is released under the following licence: GPL2