You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2019/01/22 20:20:32 UTC

[GitHub] kishoreg commented on a change in pull request #3731: Ensures that pinot-broker.log logged queries are on single lines

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org