Update clients.adoc to show how to log Request/Response for Rest5_Client (#3157)

* Update clients.adoc to show how to log Request/Response for Rest5_Client

Signed-off-by: Steven <steven.pearce@nowyoyo.com>

* Update clients.adoc to use tabs when available

---------

Signed-off-by: Steven <steven.pearce@nowyoyo.com>
This commit is contained in:
Steven 2025-11-08 17:46:28 +00:00 committed by GitHub
parent 6f0263b3af
commit bc7cfdf6e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -458,11 +458,31 @@ ClientConfiguration.builder()
== Client Logging
To see what is actually sent to and received from the server `Request` / `Response` logging on the transport level needs to be turned on as outlined in the snippet below.
This can be enabled in the Elasticsearch client by setting the level of the `tracer` package to "trace" (see
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/java-rest-low-usage-logging.html)
This can be enabled in the Elasticsearch client by setting the level of the `co.elastic.clients.transport.rest5_client.low_level.Request` package to "trace" (see
https://www.elastic.co/docs/reference/elasticsearch/clients/java/transport/rest5-client/usage/logging)
.Enable transport layer logging
[tabs]
======
XML::
+
[source,xml]
----
<logger name="tracer" level="trace"/>
<logger name="co.elastic.clients.transport.rest5_client.low_level.Request" level="trace"/>
----
yml::
+
[source,yml]
----
logging.level:
co.elastic.clients.transport.rest5_client.low_level.Request: trace
----
ini::
+
[source,ini]
----
logging.level.co.elastic.clients.transport.rest5_client.low_level.Request=trace
----
=====