Skip to content

Conversation

@astefan
Copy link
Contributor

@astefan astefan commented Dec 30, 2019

This PR improves the logging of ES search responses by outputting several meta details, excluding the documents themselves.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)


protected static void logSearchResponse(SearchResponse response, Logger logger) {
List<Aggregation> aggs = Collections.emptyList();
if (response.getAggregations() != null) {
Copy link
Contributor

@bpintea bpintea Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: wondering if expanding this branch over the for loop wouldn't also simplify (i.e. remove) the in-loop conditional, by allowing to always append ", " and then strip last two chars outside the loop.

But otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I do have a slight preference towards the current approach. I'll merge it as is.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@astefan astefan merged commit 38eb485 into elastic:master Jan 20, 2020
astefan added a commit to astefan/elasticsearch that referenced this pull request Jan 20, 2020
astefan added a commit that referenced this pull request Jan 20, 2020
@astefan astefan deleted the logging_improvements branch January 20, 2020 14:45
astefan added a commit that referenced this pull request Jan 21, 2020
astefan added a commit that referenced this pull request Jan 21, 2020
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
@polyfractal polyfractal added v7.6.0 and removed v7.6.1 labels Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants