Search::Elasticsearch::Logger::LogAny(3pm)

Search::Elasticsearch::Logger::LogAny3pm

A log::any-based logger implementation

Version

version 8.12

Overview

Search::Elasticsearch::Logger::LogAny provides event logging and the tracing of request/response conversations with Elasticsearch nodes via the Log::Any module.

Logging refers to log events, such as node failures, pings, sniffs, etc, and should be enabled for monitoring purposes.

Tracing refers to the actual HTTP requests and responses sent to Elasticsearch nodes. Tracing can be enabled for debugging purposes, or for generating a pretty-printed "curl" script which can be used for reporting problems.

Deprecations refers to deprecation warnings returned by Elasticsearch 5.x and above. Deprecations are logged to STDERR by default.

Configuration

Logging and tracing can be enabled using Log::Any::Adapter, or by passing options to "new()" in Search::Elasticsearch.

Using log::any::adapter

Send all logging and tracing to "STDERR":

    use Log::Any::Adapter qw(Stderr);
    use Search::Elasticsearch;
    my $e = Search::Elasticsearch->new;

Send logging and deprecations to a file, and tracing to Stderr:

    use Log::Any::Adapter();
    Log::Any::Adapter->set(
        { category => 'elasticsearch.event' },
        'File',
        '/path/to/file.log'
    );
    Log::Any::Adapter->set(
        { category => 'elasticsearch.trace' },
        'Stderr'
    );
    Log::Any::Adapter->set(
        { category => 'elasticsearch.deprecation' },
        'File',
        '/path/to/deprecations.log'
    );
    use Search::Elasticsearch;
    my $e = Search::Elasticsearch->new;

USING "log_to", "trace_to" AND "deprecate_to"

Send all logging and tracing to "STDERR":

    use Search::Elasticsearch;
    my $e = Search::Elasticsearch->new(
        log_to   => 'Stderr',
        trace_to => 'Stderr',
        deprecate_to => 'Stderr'  # default
    );

Send logging and deprecations to a file, and tracing to Stderr:

    use Search::Elasticsearch;
    my $e = Search::Elasticsearch->new(
        log_to       => ['File', '/path/to/file.log'],
        trace_to     => 'Stderr',
        deprecate_to => ['File', '/path/to/deprecations.log'],
    );

See Log::Any::Adapter for more.

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

Author

Enrico Zimuel <[email protected]>

From libsearch-elasticsearch-perl 8.12-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.