Polish "Fix http status code with unknown log level"

Closes gh-8813
pull/8975/head
Stephane Nicoll 8 years ago
parent cf08162148
commit 82ac8b5ca1

@ -68,15 +68,17 @@ public class LoggersMvcEndpoint extends EndpointMvcAdapter {
// disabled
return getDisabledResponse();
}
String level = configuration.get("configuredLevel");
LogLevel logLevel;
try {
LogLevel logLevel = level == null ? null : LogLevel.valueOf(level.toUpperCase());
this.delegate.setLogLevel(name, logLevel);
return ResponseEntity.ok().build();
String level = configuration.get("configuredLevel");
logLevel = level == null ? null : LogLevel.valueOf(level.toUpperCase());
}
catch (IllegalArgumentException ex) {
return ResponseEntity.badRequest().build();
}
this.delegate.setLogLevel(name, logLevel);
return ResponseEntity.ok().build();
}
}

Loading…
Cancel
Save