playframework / playframework/play1
Bad requests should not be log errors
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 671
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
Submitting this, as I don't have the time or possibility to implement this myself.
Our log monitoring is lightying up like a Christmas tree, when sombody are penetration scanning our website.
For example failure to bind for example enum values should not be ERROR, but WARN logs. As they not system-level errors, but rather a fairly normal "bad request".
The same is the case for requestion actions / content-types that are not implemented. (Like requesting an existng action but with only text/plain response allowed). This should be a 404 as response, and not an ERROR in the log.
Perhaps the same for IllegalArgumentException thrown from action method: could be considered a simple bad request, and not a system-level ERROR, although this could also be considered bad practice as validation behaviour.
Possibly there are other similar cases in the binding and action invocation implementation?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the binding and action invocation implementation, focusing on enum binding failures, unsupported actions or content types, and IllegalArgumentException handling. Review how these cases are logged and how their responses are produced; done means ordinary bad requests no longer appear as ERROR logs while the described response behavior is preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100