Return-Path: X-Original-To: apmail-kafka-dev-archive@www.apache.org Delivered-To: apmail-kafka-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38A9B18E89 for ; Tue, 4 Aug 2015 00:22:05 +0000 (UTC) Received: (qmail 3410 invoked by uid 500); 4 Aug 2015 00:22:04 -0000 Delivered-To: apmail-kafka-dev-archive@kafka.apache.org Received: (qmail 3308 invoked by uid 500); 4 Aug 2015 00:22:04 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 3293 invoked by uid 99); 4 Aug 2015 00:22:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2015 00:22:04 +0000 Date: Tue, 4 Aug 2015 00:22:04 +0000 (UTC) From: "Ismael Juma (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-2285) Logging trait obfuscates call site information MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14652841#comment-14652841 ] Ismael Juma commented on KAFKA-2285: ------------------------------------ Better than a macro would be using @inline, but sadly that doesn't work for trait methods: https://issues.scala-lang.org/browse/SI-4767 We could have a logger class instead, but that's a bigger change. > 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)