More extensive Elasticsearch request/response logging


It would be interesting and would help a lot in development, if we could see the output Json sent to elasticsearch, similar to what we have in hibernate for SQL.

Maybe some property to enable it like this:

Thank you.




Yoann Rodière
August 28, 2017, 8:43 AM

Hello ,

We already provide this feature through the logger. Set its level to DEBUG or more verbose, and all search queries will be logged.
If you want to log every request sent to the Elasticsearch cluster (including PUT/DELETE etc.), you can use the logger (set its level to TRACE or more verbose).
See here:

The logger does not print the JSON content of requests though, mainly because it would be very, very verbose (you can have hundreds of documents in one request). I suppose we could add options to control that, or maybe show only path + query parameters at the DEBUG level, and the whole request at the TRACE level.

And of course, there's the problem of formatting. We could add a configuration option for that, controlling formatting for both the and loggers.

Any remarks about the above, before we start working on it?

Leandro Kersting de Freitas
August 28, 2017, 1:16 PM

Hello ,

I think it's a good idea.

My suggestion would be more for loggers in the requests, of course the response is important.
We could also have a configuration option for response.

It would help a lot in development, and of course the developer needs to be aware that the logs might be giants, but it could benefit us in tracking down possible errors and behaviors.

I could do a PR, but I'm not updated to the code of this project. Maybe you can designate another person.


Yoann Rodière


Leandro Kersting de Freitas



Suitable for new contributors


Feedback Requested



Fix versions

Affects versions