Skip to content

Conversation

@eddumelendez
Copy link
Contributor

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

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 spring-projectsgh-10568
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 10, 2017
@philwebb philwebb added priority: normal type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 11, 2017
@philwebb philwebb added this to the 1.5.8 milestone Oct 11, 2017
@wilkinsona
Copy link
Member

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

@wilkinsona wilkinsona self-assigned this Oct 13, 2017
wilkinsona added a commit that referenced this pull request Oct 13, 2017
* gh-10588:
  Polish "Provide informative reason when rejecting request with invalid level"
  Provide informative reason when rejecting request with invalid level
@eddumelendez eddumelendez deleted the gh-10568 branch January 17, 2018 13:32
@UtsaVakani
Copy link

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

@wilkinsona
Copy link
Member

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

@Test
public void setLoggerWithWrongLogLevelResultInBadRequestResponse() {
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.APPLICATION_JSON)
.syncBody(Collections.singletonMap("configuredLevel", "other")).exchange()
.expectStatus().isBadRequest();
verifyZeroInteractions(this.loggingSystem);
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants