You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/01/08 21:46:18 UTC

[GitHub] gianm commented on a change in pull request #6302: Add SQL id, request logs, and metrics

gianm commented on a change in pull request #6302: Add SQL id, request logs, and metrics
URL: https://github.com/apache/incubator-druid/pull/6302#discussion_r246158328
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/server/log/FileRequestLogger.java
 ##########
 @@ -127,12 +130,22 @@ public void stop()
   }
 
   @Override
-  public void log(RequestLogLine requestLogLine) throws IOException
+  public void logNativeQuery(RequestLogLine requestLogLine) throws IOException
+  {
+    logToFile(requestLogLine.getNativeQueryLine(objectMapper));
+  }
+
+  @Override
+  public void logSqlQuery(RequestLogLine requestLogLine) throws IOException
+  {
+    logToFile(requestLogLine.getSqlQueryLine(objectMapper));
+  }
+
+  private void logToFile(final String message) throws IOException
   {
     synchronized (lock) {
-      fileWriter.write(
-          StringUtils.format("%s%n", requestLogLine.getLine(objectMapper))
 
 Review comment:
   Why replace `%n` with `\n`?

----------------------------------------------------------------
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: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org