NAME
Log::Log4perl::Appender::Elasticsearch - Log to Elasticsearch
VERSION
Version 0.03
SYNOPSIS
use Log::Log4perl;
Log::Log4perl->init(\<<'HERE');
log4perl.logger=DEBUG, ES
log4perl.appender.ES = Log::Log4perl::Appender::Elasticsearch
log4perl.appender.ES.layout = Log::Log4perl::Layout::NoopLayout
log4perl.appender.ES.body.level = %p
log4perl.appender.ES.body.module = %M
log4perl.appender.ES.body.line = %L
log4perl.appender.ES.nodes = localhost:9200
log4perl.appender.ES.index = log4perl
log4perl.appender.ES.type = entry
log4perl.appender.ES.use_https = 0
log4perl.appender.ES.user_agent.timeout = 5
log4perl.appender.ES.headers.User-Agent = foo
HERE
Log::Log4perl::get_logger()->info("OK");
# look up:
# curl -XPOST 'http://localhost:9200/log4perl/_search' -d \
# '{"query": {"query_string": {"query": "level:INFO AND message:OK"}}}'
# ...
# "_source": {
# "module": "main::__ANON__",
# "line": "60",
# "level": "INFO",
# "message": "OK"
# }
DESCRIPTION
This is a simple appender for providing the log messages to elasticsearch. LWP::UserAgent is used for message sending via PUT request.
OPTIONS
- nodes
-
a comma separeted list of nodes. The message will be sent to the next node only if previous request failed
- index
-
The name of the elasticsearch index the message will be stored in.
- type
-
The name of the type in given index the message belongs to.
- use_https
-
0|1 global https setting for all nodes
the individual https setting possible too:
log4perl.appender.ES.nodes = https://user:password@node1:9200,localhost:9200
- user_agent
-
LWP::UserAgent parameters.
log4perl.appender.ES.user_agent.timeout = 5
- headers
-
HTTP::Headers parameters
log4perl.appender.ES.headers.User-Agent = foo
AUTHOR
Alexei Pastuchov <palik at cpan.com>
BUGS
Please report any bugs or feature requests to bug-log-log4perl-appender-elasticsearch at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Log-Log4perl-Appender-Elasticsearch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Log::Log4perl::Appender::Elasticsearch
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Log-Log4perl-Appender-Elasticsearch
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Log-Log4perl-Appender-Elasticsearch
CPAN Ratings
http://cpanratings.perl.org/d/Log-Log4perl-Appender-Elasticsearch
Search CPAN
http://search.cpan.org/dist/Log-Log4perl-Appender-Elasticsearch/
REPOSITORY
https://github.com/p-alik/Log-Log4perl-Appender-Elasticsearch.git
LICENSE AND COPYRIGHT
Copyright 2014 by Alexei Pastuchov <palik at cpan.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.