public synchronized LoggerLevel level(String logger) {
        Objects.requireNonNull(logger, "Logger may not be null");

        org.apache.log4j.Logger foundLogger = null;
        if (ROOT_LOGGER_NAME.equalsIgnoreCase(logger)) {
            foundLogger = rootLogger();
        } else {
            Enumeration<org.apache.log4j.Logger> en = currentLoggers();
            // search within existing loggers for the given name.
            // using LogManger.getLogger() will create a logger if it doesn't exist
            // (potential leak since these don't get cleaned up).
            while (en.hasMoreElements()) {
                org.apache.log4j.Logger l = en.nextElement();
                if (logger.equals(l.getName())) {
                    foundLogger = l;
                    break;
                }
            }
        }

        if (foundLogger == null) {
            log.warn("Unable to find level for logger {}", logger);
            return null;
        }

        return loggerLevel(foundLogger);
    }
Retrieve the current level for a single logger.
@param logger the name of the logger to retrieve the level for; may not be null
@return the current level (falling back on the effective level if necessary) of the logger,
or null if no logger with the specified name exists
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java