Previously, bad request with no reason was included in the response. This commit introduces the reason when invalid log level is sent in the request.

See gh-10568

Comment From: wilkinsona

I've opened #10618 to do something more general purpose in the web endpoint infrastructure for 2.0.

Comment From: UtsaVakani

Hello, I am using 2.1.3.RELEASE version and still getting 500 on giving improper configuredLevel in POST payload for /loggers endpoint ...

Comment From: wilkinsona

@UtsaVakani You should get a 400 for an unrecognised configuredLevel. We have an integration test that verifies that this is the case:

https://github.com/spring-projects/spring-boot/blob/f15e04b3926f20c01e9ae986a56eac43b8cdebf5/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logging/LoggersEndpointWebIntegrationTests.java#L122-L129

If you are seeing different behaviour, please open a new issue with a small sample project that reproduces the 500 response.