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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java:
##########
@@ -198,26 +194,37 @@ org.apache.logging.log4j.Logger rootLogger() {
     }
 
     private void setLevel(org.apache.logging.log4j.Logger logger, Level level) 
{
-        String loggerName = logger.getName();
-        LoggerContext context = (LoggerContext) LogManager.getContext(false);
-        LoggerConfig loggerConfig = 
context.getConfiguration().getLoggerConfig(loggerName);
-        Level currentLevel = loggerConfig.getLevel();
+        Level currentLevel = logger.getLevel();
 
         if (level.equals(currentLevel)) {
-            log.debug("Skipping update for logger {} since its level is 
already {}", loggerName, level);
+            log.debug("Skipping update for logger {} since its level is 
already {}", logger.getName(), level);
             return;
         }
 
-        log.debug("Setting level of logger {} (excluding children) to {}", 
loggerName, level);
-        Configurator.setLevel(loggerName, level);
-        lastModifiedTimes.put(loggerName, time.milliseconds());
+        log.debug("Setting level of logger {} (excluding children) to {}", 
logger.getName(), level);
+        Configurator.setLevel(logger.getName(), level);

Review Comment:
   according to 
https://github.com/apache/logging-log4j2/issues/2281#issue-2130099964, this can 
change all childs' level - that means the changed logger could have no last 
modified time
   
   Maybe we need to trace all loggers the changes manually



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