[MGNLREST-297] Improve logging of RestExceptionMapper Created: 25/Feb/21  Updated: 25/Mar/22

Status: Accepted
Project: Magnolia REST Framework
Component/s: integration
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Tobias Szczepanski Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

The info.magnolia.rest.RestExceptionMapper logs an error and the stacktrace (except for NotAcceptableException). The stacktrace seems to be abused for logging the source endpoint/method, and clutters the logs.

Acceptance Criteria

  1. Decorated WebApplicationException exists which takes as arguments:
    1. The URI of the resource
    2. The HTTP Method
    3. The method's FQN
  2. Decorated WebApplicationException formats the log message containing the above arguments
  3. RestExceptionMapper logs an info (instead of an error)
  4. RestExceptionMapper logs exactly one line.

 

Technical Details

Logging an error in the server for a client error is not ideal. The client error represents an error to the client, hence the error response. To the server it should represent every day business though, hence an Info would be more appropriate.


Generated at Mon Feb 12 06:58:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.