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 extra method 
invocation is going to have a significant performance impact for logging, even 
broker-side, but I don't mind erring on the side of caution here for now. I've 
closed my PR against this branch; we can always revisit later.
   
   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-unsubscr...@kafka.apache.org

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

Reply via email to