frankvicky commented on code in PR #17373:
URL: https://github.com/apache/kafka/pull/17373#discussion_r1812371827


##########
core/src/main/scala/kafka/utils/Log4jController.scala:
##########
@@ -17,83 +17,86 @@
 
 package kafka.utils
 
+import org.apache.logging.log4j.core.LoggerContext
+import org.apache.logging.log4j.core.config.Configurator
+import org.apache.logging.log4j.{Level, LogManager}
+
 import java.util
 import java.util.Locale
-
-import org.apache.kafka.common.utils.Utils
-import org.apache.log4j.{Level, LogManager, Logger}
-
-import scala.collection.mutable
 import scala.jdk.CollectionConverters._
 
 
 object Log4jController {
-  val ROOT_LOGGER = "root"
-
-  private def resolveLevel(logger: Logger): String = {

Review Comment:
   Yes, log4j2 will do it for us.
   In Log4j2, when we retrieve a Logger instance from the `LoggerContext`, the 
`getLevel` method returns the effective log level, which includes any levels 
inherited from parent loggers up to the root logger. This means that if a 
logger doesn’t have an explicit level set, `getLevel` will provide the 
inherited level, so we don’t need to manually traverse the logger hierarchy as 
we did in the `resolveLevel` method.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to