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/04/05 14:52:23 UTC

[GitHub] [incubator-druid] gianm commented on issue #7362: Principles for choosing logging severity

gianm commented on issue #7362: Principles for choosing logging severity
URL: https://github.com/apache/incubator-druid/issues/7362#issuecomment-480305168
 
 
   Three thoughts on this that are maybe related, but also stand alone:
   
   1) I have definitely used debug/trace logs to find bugs before, but I would say even more often is using them to find root causes of problems that are not really bugs. For example, the debug logs for memory allocations are at debug level because they are too noisy to log in normal operation, but are useful to enable when trying to figure out what is eating up all the memory. For another example, debug logs that log each HTTP request/response are useful for tracking down the root cause of some service-to-service communication problem, or for tracking down the root cause of an unexpected query result.
   
   2) Sometimes, when writing code, debug or trace logs for me replace comments. Instead of writing a comment like 'Skip zero length chunk' we can include a log statement like `log.debug("Skipping zero length chunk");`. I guess this would be fine as a comment too, but making it a comment doesn't really make the code clearer, and it lets people enable debug logs so they can see how control flows around. I do this sometimes when writing or debugging unit tests.
   
   3) I generally feel that the INFO logs in Druid are too noisy today, but some of them are not things I'd want to remove, due to points 1 & 2 above. So I would support a program of demoting more INFO logs to DEBUG level, and DEBUG to TRACE, with the idea being that Druid logging by default should be a lot 'quieter', but you can enable DEBUG level logging to get what you get with INFO today, and TRACE to get things like each and every HTTP request/response and memory allocation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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