NAME

OpenSearch::Client::Logger::LogAny - A Log::Any-based Logger implementation

VERSION

version 3.007004

DESCRIPTION

OpenSearch::Client::Logger::LogAny provides event logging and the tracing of request/response conversations with OpenSearch 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 OpenSearch 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 OpenSearch. 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 OpenSearch::Client.

USING LOG::ANY::ADAPTER

Send all logging and tracing to STDERR:

use Log::Any::Adapter qw(Stderr);
use OpenSearch::Client;
my $os = OpenSearch::Client->new;

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

use Log::Any::Adapter();
Log::Any::Adapter->set(
    { category => 'opensearch.event' },
    'File',
    '/path/to/file.log'
);
Log::Any::Adapter->set(
    { category => 'opensearch.trace' },
    'Stderr'
);
Log::Any::Adapter->set(
    { category => 'opensearch.deprecation' },
    'File',
    '/path/to/deprecations.log'
);

use OpenSearch::Client;
my $os = OpenSearch::Client->new;

USING log_to, trace_to AND deprecate_to

Send all logging and tracing to STDERR:

use OpenSearch::Client;
my $os = OpenSearch::Client->new(
    log_to   => 'Stderr',
    trace_to => 'Stderr',
    deprecate_to => 'Stderr'  # default
);

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

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

See Log::Any::Adapter for more.

MANUAL

Documentation index OpenSearch::Client::Manual

HISTORY

This distribution is derived from Search::Elasticsearch version 7.714. All subsequent changes are unique to this distribution.

AUTHOR

Mark Dootson <mdootson@cpan.org> ( current maintainer )

CREDITS

OpenSearch::Client is based on Search::Elasticsearch version 7.714 by Enrico Zimuel <enrico.zimuel@elastic.co>.

COPYRIGHT AND LICENSE

Copyright (C) 2026 by Mark Dootson ( this distribution )

Copyright (C) 2021 by Elasticsearch BV ( original distribution )

This is free software, licensed under:

The Apache License, Version 2.0, January 2004