NAME

Log::Log4perl::Appender::Elasticsearch - Log to Elasticsearch

VERSION

Version 0.01

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"
#        }

SUBROUTINES/METHODS

new

_init(%p)

log(%p)

_send_request($b)

_uri($node, $id)

_headers($uri)

_request($uri, $b)

_prepare_body(%p)

AUTHOR

Alexei Pastuchov <palik@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:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2014 by Alexei Pastuchov <palik@cpan.com>.

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