Log::Log4perl::Appender::Fluent - log appender writing to Fluentd
log4perl.category = INFO, Fluentd # ... log4perl.appender.Fluentd = Log::Log4perl::Appender::Fluent log4perl.appender.Fluentd.host = fluentd.example.net # this port is default for Fluentd #log4perl.appender.Fluentd.port = 24224 log4perl.appender.Fluentd.hostname_field = source_host log4perl.appender.Fluentd.tag_prefix = example # these two options prevent the message from being stringified log4perl.appender.Fluentd.layout = Log::Log4perl::Layout::NoopLayout log4perl.appender.Fluentd.warp_message = 0
Log::Log4perl::Appender::Fluent is a Log::Log4perl(3) appender plugin that provides output to Fluentd daemon. The plugin supports sending simple string messages, but it works way better when is provided with Log::Message::JSON(3) or Log::Message::Structured(3) object, because the structure of the message will be preserved.
Following options are available in Log::Log4perl(3) config:
Path to UNIX socket, where Fluentd listens. If specified, communication with Fluentd instance will go through this socket, otherwise TCP protocol will be used.
localhost
24224
Fluentd instance's address. If neither host/port nor socket is specified, due to default values, TCP communication will take place.
message
Communication with Fluentd imposes using hashes as messages. This option tells how should be named key if the message is not a Log::Message::JSON(3)/Log::Message::Structured(3) object.
Fluentd on its own doesn't provide the information where the record comes from. Setting hostname_field will make this module to add (replace) necessary field in messages.
These options, similarly to hostname_field, specify where to put message's category and level.
If tag is set, this will be the tag for messages. If tag_prefix is set, message will have the tag set to this prefix plus message's category. If neither tag nor tag_prefix is set, message's tag is equal to category.
tag has the precedence from these two if both set.
If the destination host is unavailable, this module may print error messages using warn().
warn()
Stanislaw Klekot, <cpan at jarowit.net>
<cpan at jarowit.net>
Copyright 2012 Stanislaw Klekot.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
http://fluentd.org/, Log::Log4perl(3), Log::Message::JSON(3), Log::Message::Structured(3).
To install Log::Log4perl::Appender::Fluent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Log4perl::Appender::Fluent
CPAN shell
perl -MCPAN -e shell install Log::Log4perl::Appender::Fluent
For more information on module installation, please visit the detailed CPAN module installation guide.