@PUT
    @Path("/{logger}")
    @Operation(summary = "Set the log level for the specified logger")
    @SuppressWarnings("fallthrough")
    public Response setLevel(final @PathParam("logger") String namespace,
                             final Map<String, String> levelMap,
                             @DefaultValue("worker") @QueryParam("scope") @Parameter(description = "The scope for the logging modification (single-worker, cluster-wide, etc.)") String scope) {
        if (scope == null) {
            log.warn("Received null scope in request to adjust logging level; will default to {}", WORKER_SCOPE);
            scope = WORKER_SCOPE;
        }

        String levelString = levelMap.get("level");
        if (levelString == null) {
            throw new BadRequestException("Desired 'level' parameter was not specified in request.");
        }

        // Make sure that this is a valid level
        Level level = Level.toLevel(levelString.toUpperCase(Locale.ROOT), null);
        if (level == null) {
            throw new NotFoundException("invalid log level '" + levelString + "'.");
        }

        switch (scope.toLowerCase(Locale.ROOT)) {
            default:
                log.warn("Received invalid scope '{}' in request to adjust logging level; will default to {}", scope, WORKER_SCOPE);
            case WORKER_SCOPE:
                List<String> affectedLoggers = herder.setWorkerLoggerLevel(namespace, levelString);
                return Response.ok(affectedLoggers).build();
            case CLUSTER_SCOPE:
                herder.setClusterLoggerLevel(namespace, levelString);
                return Response.noContent().build();
        }
    }
Adjust level of a named logger. If the name corresponds to an ancestor, then the log level is applied to all child loggers.

@param namespace name of the logger
@param levelMap a map that is expected to contain one key 'level', and a value that is one of the log4j levels:
                DEBUG, ERROR, FATAL, INFO, TRACE, WARN
@return names of loggers whose levels were modified
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/resources/LoggingResource.java