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/05/24 02:16:17 UTC

[GitHub] [kafka] dengziming commented on a diff in pull request #12194: MINOR: Include listener name in SocketServer acceptor and processor log context

dengziming commented on code in PR #12194:
URL: https://github.com/apache/kafka/pull/12194#discussion_r879997413


##########
core/src/main/scala/kafka/network/SocketServer.scala:
##########
@@ -242,13 +241,14 @@ class SocketServer(val config: KafkaConfig,
   }
 
   private def endpoints = config.listeners.map(l => l.listenerName -> l).toMap
+  private def endpointLogContext(endpoint: EndPoint): LogContext = new LogContext(s"[$logPrefix, listener=${endpoint.listenerName.value}] ")
 
   protected def createDataPlaneAcceptor(endPoint: EndPoint, isPrivilegedListener: Boolean, requestChannel: RequestChannel): DataPlaneAcceptor = {
-    new DataPlaneAcceptor(this, endPoint, config, nodeId, connectionQuotas, time, isPrivilegedListener, requestChannel, metrics, credentialProvider, logContext, memoryPool, apiVersionManager)
+    new DataPlaneAcceptor(this, endPoint, config, nodeId, connectionQuotas, time, isPrivilegedListener, requestChannel, metrics, credentialProvider, endpointLogContext(endPoint), memoryPool, apiVersionManager)

Review Comment:
   We have 2 abstract methods in Acceptor:
   ```
     def metricPrefix(): String
     def threadPrefix(): String
   ```
   how about adding another similar method: `def logPrefix(): String`
   



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