The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Log::Log4perl::Appender::Elasticsearch - implements appending to Elasticsearch

VERSION

Version 0.04

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

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:

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.