You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by js...@apache.org on 2022/10/14 18:27:44 UTC

[kafka] branch trunk updated: MINOR; Add kraft controller log level in log4j prop (#12707)

This is an automated email from the ASF dual-hosted git repository.

jsancio pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 78b4ba7d85a MINOR; Add kraft controller log level in log4j prop (#12707)
78b4ba7d85a is described below

commit 78b4ba7d85a6739ff308ef8d7af678c63ac06ef6
Author: Luke Chen <sh...@gmail.com>
AuthorDate: Sat Oct 15 02:27:31 2022 +0800

    MINOR; Add kraft controller log level in log4j prop (#12707)
    
    Add KRaft controller log level entry in log4j.properties, otherwise, the controller.log is empty in KRaft mode.
    
    Reviewers: José Armando García Sancio <js...@apache.org>, Ismael Juma <is...@juma.me.uk>
---
 config/log4j.properties                                              | 5 +++++
 .../main/scala/kafka/server/BrokerToControllerChannelManager.scala   | 2 +-
 core/src/main/scala/kafka/server/KafkaRaftServer.scala               | 2 --
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/config/log4j.properties b/config/log4j.properties
index 4cbce9d1042..4dbdd83f83b 100644
--- a/config/log4j.properties
+++ b/config/log4j.properties
@@ -76,6 +76,11 @@ log4j.additivity.kafka.request.logger=false
 log4j.logger.kafka.network.RequestChannel$=WARN, requestAppender
 log4j.additivity.kafka.network.RequestChannel$=false
 
+# Change the line below to adjust KRaft mode controller logging
+log4j.logger.org.apache.kafka.controller=INFO, controllerAppender
+log4j.additivity.org.apache.kafka.controller=false
+
+# Change the line below to adjust ZK mode controller logging
 log4j.logger.kafka.controller=TRACE, controllerAppender
 log4j.additivity.kafka.controller=false
 
diff --git a/core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala b/core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala
index a4879798342..99e86722f2f 100644
--- a/core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala
+++ b/core/src/main/scala/kafka/server/BrokerToControllerChannelManager.scala
@@ -370,7 +370,7 @@ class BrokerToControllerRequestThread(
       debug("Controller isn't cached, looking for local metadata changes")
       controllerNodeProvider.get() match {
         case Some(controllerNode) =>
-          info(s"Recorded new controller, from now on will use broker $controllerNode")
+          info(s"Recorded new controller, from now on will use node $controllerNode")
           updateControllerAddress(controllerNode)
           metadataUpdater.setNodes(Seq(controllerNode).asJava)
         case None =>
diff --git a/core/src/main/scala/kafka/server/KafkaRaftServer.scala b/core/src/main/scala/kafka/server/KafkaRaftServer.scala
index 63f77d1a43d..84ea10da57f 100644
--- a/core/src/main/scala/kafka/server/KafkaRaftServer.scala
+++ b/core/src/main/scala/kafka/server/KafkaRaftServer.scala
@@ -47,8 +47,6 @@ import scala.jdk.CollectionConverters._
  * constructing the controller and/or broker based on the `process.roles`
  * configuration and for managing their basic lifecycle (startup and shutdown).
  *
- * Note that this server is a work in progress and we are releasing it as
- * early access in 2.8.0.
  */
 class KafkaRaftServer(
   config: KafkaConfig,