Skip to content

Commit

Permalink
MINOR; Add kraft controller log level in log4j prop (apache#12707)
Browse files Browse the repository at this point in the history
Add KRaft controller log level entry in log4j.properties, otherwise, the controller.log is empty in KRaft mode.

Reviewers: José Armando García Sancio <[email protected]>, Ismael Juma <[email protected]>
  • Loading branch information
showuon authored Oct 14, 2022
1 parent f1e0fa9 commit 78b4ba7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/kafka/server/KafkaRaftServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 78b4ba7

Please sign in to comment.