diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java index f3c69e3aab1c..6e8d039f3174 100644 --- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java +++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java @@ -212,8 +212,14 @@ private LoggerLevel loggerLevel(org.apache.logging.log4j.Logger logger) { } private boolean isValidRootLoggerName(String namespace) { - return VALID_ROOT_LOGGER_NAMES.stream() - .anyMatch(rootLoggerNames -> rootLoggerNames.equalsIgnoreCase(namespace)); + boolean result = false; + for (String rootLoggerName : VALID_ROOT_LOGGER_NAMES) { + if (rootLoggerName.equalsIgnoreCase(namespace)) { + result = true; + break; + } + } + return result; } /** @@ -225,6 +231,6 @@ private boolean isValidRootLoggerName(String namespace) { * @return The logger name - returns "root" for empty string, otherwise returns the original logger name */ private String getLoggerName(org.apache.logging.log4j.Logger logger) { - return logger.getName().equals(LogManager.ROOT_LOGGER_NAME) ? ROOT_LOGGER_NAME : logger.getName(); + return logger.getName().equalsIgnoreCase(LogManager.ROOT_LOGGER_NAME) ? ROOT_LOGGER_NAME : logger.getName(); } }