ppkarwasz commented on code in PR #18496: URL: https://github.com/apache/kafka/pull/18496#discussion_r1931141174
########## connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java: ########## @@ -52,184 +53,274 @@ public class Loggers { /** * Log4j uses "root" (case-insensitive) as name of the root logger. * Note: In log4j, the root logger's name was "root" and Kafka also followed that name for dynamic logging control feature. - * + * <p> * While log4j2 changed the root logger's name to empty string (see: [[LogManager.ROOT_LOGGER_NAME]]), * for backward-compatibility purposes, we accept both empty string and "root" as valid root logger names. * This is why we have a dedicated definition that includes both values. + * </p> */ private static final List<String> VALID_ROOT_LOGGER_NAMES = List.of(LogManager.ROOT_LOGGER_NAME, ROOT_LOGGER_NAME); - private final Time time; + final Time time; /** * Maps logger names to their last modification timestamps. * Note: The logger name "root" refers to the actual root logger of log4j2. */ - private final Map<String, Long> lastModifiedTimes; + final Map<String, Long> lastModifiedTimes; - public Loggers(Time time) { + /** + * Creates a {@link Loggers} instance appropriate for the current environment. + * + * @param time A time source. + * @return A new {@link Loggers} instance, never {@link null}. + */ + public static Loggers newInstance(Time time) { + Objects.requireNonNull(time); + try { + return new Log4jLoggers(time); + } catch (ClassCastException | LinkageError e) { Review Comment: _ditto_ Fixed in https://github.com/apache/kafka/pull/18496/commits/09a9131a1b98737ab2495fed5eb43d56203c80bd -- 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