@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();
        }
    }
@Test
    public void setLevelWithInvalidArgTest() {
        for (String scope : Arrays.asList("worker", "cluster", "N/A", null)) {
            assertThrows(
                    NotFoundException.class,
                    () -> loggingResource.setLevel(
                            "@root",
                            Collections.singletonMap("level", "HIGH"),
                            scope
                    )
            );
        }
    }