kishoreg commented on a change in pull request #3731: Ensures that
pinot-broker.log logged queries are on single lines
URL: https://github.com/apache/incubator-pinot/pull/3731#discussion_r249945137
##########
File path:
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -120,7 +120,8 @@ public BrokerResponse handleRequest(JsonNode request,
@Nullable RequesterIdentit
requestStatistics.setRequestArrivalTimeMillis(System.currentTimeMillis());
String query = request.get(PQL).asText();
- LOGGER.debug("Query string for request {}: {}", requestId, query);
+ String queryLoggable = StringUtils.substring(query.replace("\n", "\\n"),
0, _queryLogLength);
Review comment:
extract this to a method and invoke only when needed. Looks like we log it
only in debug / error cases.
Also, better to trim first and then replace.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]