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/30 19:05:00 UTC

[GitHub] mirkojotic commented on issue #6580: FileRequestLogger fails when used with FilteredRequestLogger

mirkojotic commented on issue #6580: FileRequestLogger fails when used with FilteredRequestLogger
URL: https://github.com/apache/incubator-druid/issues/6580#issuecomment-459068032
 
 
   @jon-wei I tried to reproduce this but I couldn't
   
   ```
       ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
   
       String HOST = "localhost";
       ObjectMapper objectMapper = new ObjectMapper();
       DateTime dateTime = DateTimes.nowUtc();
       File logDir = new File("/tmp/druid-logs");
       String nativeQueryLogString = dateTime + "\t" + HOST + "\t" + "native";
   
       FileRequestLogger delegate = new FileRequestLogger(objectMapper, scheduler, logDir, "yyyy-MM-dd'.log'");
       FilteredRequestLoggerProvider.FilteredRequestLogger logger = new FilteredRequestLoggerProvider.FilteredRequestLogger(
               delegate,
               1000,
               900
       );
       try {
         logger.start();
       } catch (Exception e) {
         e.printStackTrace();
       }
   
       RequestLogLine requestLogLine = RequestLogLine.forSql(
               nativeQueryLogString,
               new HashMap<>(),
               dateTime,
               HOST,
               new QueryStats(ImmutableMap.of("sqlQuery/time", 1000))
       );
   
       logger.logSqlQuery(requestLogLine);
   ```
   
   Is there something I'm missing? It writes to log file I've specified.

----------------------------------------------------------------
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