.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Role::Logger 3pm" .TH Search::Elasticsearch::Role::Logger 3pm 2024-02-04 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Search::Elasticsearch::Role::Logger \- Provides common functionality to Logger implementations .SH VERSION .IX Header "VERSION" version 8.12 .SH DESCRIPTION .IX Header "DESCRIPTION" This role provides common functionality to Logger implementations, to enable the logging of events and the tracing of request-response conversations with Elasticsearch nodes. .PP See Search::Elasticsearch::Logger::LogAny for the default implementation. .SH CONFIGURATION .IX Header "CONFIGURATION" .ie n .SS """log_to""" .el .SS \f(CWlog_to\fP .IX Subsection "log_to" Parameters passed to \f(CW\*(C`log_to\*(C'\fR are used by Search::Elasticsearch::Role::Logger implementations to setup the "\fBlog_handle()\fR". See Search::Elasticsearch::Logger::LogAny for details. .ie n .SS """log_as""" .el .SS \f(CWlog_as\fP .IX Subsection "log_as" By default, events emitted by "\fBdebug()\fR", "\fBinfo()\fR", "\fBwarning()\fR", "\fBerror()\fR" and "\fBcritical()\fR" are logged to the "\fBlog_handle()\fR" under the category \f(CW"elasticsearch.event"\fR, which can be configured with \f(CW\*(C`log_as\*(C'\fR. .ie n .SS """trace_to""" .el .SS \f(CWtrace_to\fP .IX Subsection "trace_to" Parameters passed to \f(CW\*(C`trace_to\*(C'\fR are used by Search::Elasticsearch::Role::Logger implementations to setup the "\fBtrace_handle()\fR". See Search::Elasticsearch::Logger::LogAny for details. .ie n .SS """trace_as""" .el .SS \f(CWtrace_as\fP .IX Subsection "trace_as" By default, trace output emitted by "\fBtrace_request()\fR", "\fBtrace_response()\fR", "\fBtrace_error()\fR" and "\fBtrace_comment()\fR" are logged under the category \&\f(CW\*(C`elasticsearch.trace\*(C'\fR, which can be configured with \f(CW\*(C`trace_as\*(C'\fR. .ie n .SS """deprecate_to""" .el .SS \f(CWdeprecate_to\fP .IX Subsection "deprecate_to" Parameters passed to \f(CW\*(C`deprecate_to\*(C'\fR are used by Search::Elasticsearch::Role::Logger implementations to setup the "\fBdeprecate_handle()\fR". See Search::Elasticsearch::Logger::LogAny for details. .ie n .SS """deprecate_as""" .el .SS \f(CWdeprecate_as\fP .IX Subsection "deprecate_as" By default, events emitted by "\fBdeprecation()\fR" are logged to the "\fBdeprecate_handle()\fR" under the category \f(CW"elasticsearch.deprecation"\fR, which can be configured with \f(CW\*(C`deprecate_as\*(C'\fR. .SH METHODS .IX Header "METHODS" .ie n .SS log_handle() .el .SS \f(CWlog_handle()\fP .IX Subsection "log_handle()" Returns an object which can handle the methods: \&\f(CWdebug()\fR, \f(CWdebugf()\fR, \f(CWis_debug()\fR, \f(CWinfo()\fR, \f(CWinfof()\fR, \f(CWis_info()\fR, \&\f(CWwarning()\fR, \f(CWwarningf()\fR, \f(CWis_warning()\fR, \f(CWerror()\fR, \f(CWerrorf()\fR, \&\f(CWis_error()\fR, \f(CWcritical()\fR, \f(CWcriticalf()\fR and \f(CWis_critical()\fR. .ie n .SS trace_handle() .el .SS \f(CWtrace_handle()\fP .IX Subsection "trace_handle()" Returns an object which can handle the methods: \&\f(CWtrace()\fR, \f(CWtracef()\fR and \f(CWis_trace()\fR. .ie n .SS deprecate_handle() .el .SS \f(CWdeprecate_handle()\fP .IX Subsection "deprecate_handle()" Returns an object which can handle the \f(CWwarnf()\fR method. .ie n .SS trace_request() .el .SS \f(CWtrace_request()\fP .IX Subsection "trace_request()" .Vb 1 \& $logger\->trace_request($cxn,\e%request); .Ve .PP Accepts a Cxn object and request parameters and logs them if tracing is enabled. .ie n .SS trace_response() .el .SS \f(CWtrace_response()\fP .IX Subsection "trace_response()" .Vb 1 \& $logger\->trace_response($cxn,$code,$response,$took); .Ve .PP Logs a successful HTTP response, where \f(CW$code\fR is the HTTP status code, \&\f(CW$response\fR is the HTTP body and \f(CW$took\fR is the time the request took in seconds .ie n .SS trace_error() .el .SS \f(CWtrace_error()\fP .IX Subsection "trace_error()" .Vb 1 \& $logger\->trace_error($cxn,$error); .Ve .PP Logs a failed HTTP response, where \f(CW$error\fR is an Search::Elasticsearch::Error object. .ie n .SS trace_comment() .el .SS \f(CWtrace_comment()\fP .IX Subsection "trace_comment()" .Vb 1 \& $logger\->trace_comment($comment); .Ve .PP Used to insert debugging comments into trace output. .ie n .SS deprecation() .el .SS \f(CWdeprecation()\fP .IX Subsection "deprecation()" .Vb 1 \& $logger\->deprecation($warning,$request) .Ve .PP Issues a deprecation warning to the deprecation logger. .SH AUTHOR .IX Header "AUTHOR" Enrico Zimuel .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2024 by Elasticsearch BV. .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve