You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/09/13 16:50:59 UTC

[GitHub] [kafka] C0urante commented on a diff in pull request #12020: KAFKA-13818: Add generation to consumer assignor logs

C0urante commented on code in PR #12020:
URL: https://github.com/apache/kafka/pull/12020#discussion_r969868569


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -164,13 +166,23 @@ public ConsumerCoordinator(GroupRebalanceConfig rebalanceConfig,
               metricGrpPrefix,
               time);
         this.rebalanceConfig = rebalanceConfig;
-        this.log = logContext.logger(ConsumerCoordinator.class);
+        final Supplier<String> dynamicPrefix =
+            () -> logContext.logPrefix() + "[generationId=" + generation().generationId + "] ";
+        this.log = new DynamicPrefixLogger(
+            dynamicPrefix,
+            LoggerFactory.getLogger(ConsumerCoordinator.class)
+        );

Review Comment:
   Thanks @vvcephei--I'm personally a little skeptical that one stack frame is going to have a large performance impact for logging, even broker-side, but I don't mind erring on the side of caution here for now.
   
   I do still wonder about modifying the logger used by the `AbstractCoordinator` superclass, since that's (AFAIK) only used client-side?



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

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org