[ https://issues.apache.org/jira/browse/KAFKA-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14653911#comment-14653911 ]
Ismael Juma commented on KAFKA-2285: ------------------------------------ [~granthenke], keep in mind that scala-logging only supports Scala 2.11. The previous version (which is named slightly differently: https://github.com/typesafehub/scalalogging) supported Scala 2.10. I don't think we'd want to add a dependency just for this, but it's worth keeping in mind that getting the same macro to work in 2.10 and 2.11 can sometimes be tricky (not sure about this particular case). Also, the logging trait allows one to set a prefix for log messages via `logIdent`. Finally, as stated previously, KAFKA-1351 is related. There have been some questions around String.format performance (there are over 700 occurrences of `.format` in our codebase) and String interpolation provides an interesting alternative. Still, as you pointed out, there are many instances of multi-line strings passed to String.format and it's not so clear what format we would want to use for those. A possibility: https://github.com/ijuma/kafka/commit/e2963936dfd4a24fe89f60633bf1590de43b459d People may prefer the existing way though. > Logging trait obfuscates call site information > ---------------------------------------------- > > Key: KAFKA-2285 > URL: https://issues.apache.org/jira/browse/KAFKA-2285 > Project: Kafka > Issue Type: Improvement > Components: core > Affects Versions: 0.8.2.0 > Reporter: E. Sammer > Assignee: Grant Henke > > Using a logging trait, as many components in the codebase do, destroys call > site information in logging message making debugging certain kinds of > failures annoying in production systems. Most messages end up look like: > {code} > 2015-06-18 07:41:11,550 (kafka-request-handler-0) [WARN - > kafka.utils.Logging$class.warn(Logging.scala:83)] Partition [events,1] on > broker 1: No checkpointed highwatermark is found for partition [events,1] > {code} > I think the mental overhead of issuing the standard incantation of {{private > static final Logger logger = LoggerFactory.get(Foo.class)}} (or the even > shorter Scala equivalent) for each class is outweighed by the operational > overhead of mapping strings back to their original call sites. This is an > easy win improve the traceability of complex failures in production > deployments. -- This message was sent by Atlassian JIRA (v6.3.4#6332)