Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change JsonExceptionMappers to log JSON processing errors at WARN instead of DEBUG level #519

Closed
sleberknight opened this issue Jul 12, 2024 · 1 comment · Fixed by #522
Assignees
Labels
enhancement A request for change or improvement to an existing feature
Milestone

Comments

@sleberknight
Copy link
Member

JsonExceptionMappers#toResponse logs the default "Unable to process JSON" message for JsonProcessingException at DEBUG level. This should probably be WARN by default, so that it is easier to find in logs.

The background on this issue is that we had a web application making an HTTP POST to a back-end service with invalid JSON. The back-end service was (correctly) returning a 400 Bad Request response, but the web application (for whatever reason) was ignoring the response code (obviously not good behavior). So, the only reason we found the problem was by accident, because we had the logging on the back-end service set to DEBUG level while diagnosing another problem. Changing the default log level to WARN would have made things obvious a long time ago.

@sleberknight sleberknight added the enhancement A request for change or improvement to an existing feature label Jul 12, 2024
@sleberknight sleberknight self-assigned this Aug 1, 2024
@sleberknight sleberknight added this to the 3.7.1 milestone Aug 1, 2024
sleberknight added a commit that referenced this issue Aug 1, 2024
Log JsonProcessingExceptions that do not meet specific criteria
for logging specialized messages at WARN or ERROR level, log
them as a generic "Unable to process JSON" at WARN level instead
of at DEBUG level. This can aid in debugging problems.

Closes #519
@sleberknight
Copy link
Member Author

I guess this should probably cause a minor version bump instead of a patch bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for change or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant