chia7712 commented on code in PR #19687:
URL: https://github.com/apache/kafka/pull/19687#discussion_r2094574178


##########
core/src/main/scala/kafka/server/ConfigHelper.scala:
##########
@@ -130,7 +131,7 @@ class ConfigHelper(metadataCache: MetadataCache, config: 
KafkaConfig, configRepo
             else if (resourceNameToBrokerId(resource.resourceName) != 
config.brokerId)
               throw new InvalidRequestException(s"Unexpected broker id, 
expected ${config.brokerId} but received ${resource.resourceName}")
             else
-              createResponseConfig(LoggingController.loggers,
+              createResponseConfig(LoggingController.loggers.asScala,

Review Comment:
   As logger is not a small collection, could you please consolidate 
`createResponseConfig` to avoid conversion? 



##########
server/src/main/java/org/apache/kafka/server/logger/LoggingController.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.server.logger;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * An MBean that allows the user to dynamically alter log4j levels at runtime.
+ * The companion object contains the singleton instance of this class and
+ * registers the MBean. The [[kafka.utils.Logging]] trait forces initialization
+ * of the companion object.
+ */
+public class LoggingController implements LoggingControllerMBean {
+
+    private static final Logger LOGGER = 
LogManager.getLogger(LoggingController.class);
+
+    /**
+     * Note: In Log4j 1, the root logger's name was "root" and Kafka also 
followed that name for dynamic logging control feature.
+     * The root logger's name is changed in log4j2 to empty string (see: 
[[LogManager.ROOT_LOGGER_NAME]]) but for backward-

Review Comment:
   Could you please keep "backward-" and "compatibility" on a single line.



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