playframework / playframework/play1

Bad requests should not be log errors

Open
#1,545 0 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.