Incorrect Logging Level for JSON Format Errors in POST Requests
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
## Description:
When sending a POST request with an incorrectly formatted JSON body (e.g., containing only the character '}'), the error details are logged with a Level = Debug. This logging level seems inappropriate for this type of error, and it should be logged with Level = Error instead.
Steps to Reproduce:
1. Send a POST request to the API endpoint with a malformed JSON body. For example:
`
}
`
Observe the logs generated by the application.
## Expected Behavior:
The application should log the details of the error with a logging level of Error.
## Actual Behavior:
The error details are logged with a logging level of Debug.
## Environment:
ASP.NET Core Version: 8.0
Operating System: Windows 11
## Additional Information:
Logging critical errors such as malformed JSON requests at a Debug level can obscure important issues that should be promptly addressed. Adjusting the logging level to Error will ensure these issues are more visible to developers and system administrators.
Contributor guide
Assessment
This issue has not been assessed yet.