DSpaceApiExceptionControllerAdvice logs nothing of interest
See original GitHub issueDescribe the bug
Method sendErrorResponse
is also responsible for logging the exception, but except in a few specific cases it logs only the HTTP response code, without mentioning the actual exception or location.
In the few specific cases we get a stack trace. As stated in comments, we probably don’t want that level of detail for most exceptions, but I think that we do want to know what happened and where – why are we sending this non-success response?
To Reproduce Steps to reproduce the behavior:
- Trigger a 404 response.
- See the log. All you’ll find is “org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ An exception has occurred (status:404)”.
Expected behavior When logging an exception, we should always log the actual exception and its location.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
tech\] DSpace\-CRIS - The Mail Archive
Hi everyone, We are having trouble with Dspace Cris 7 integration with external databases. There is documentation here, ...
Read more >报告一个路由设置的BUG - 2dust/V2rayN - IssueHint
DSpaceApiExceptionControllerAdvice logs nothing of interest, 6, 2022-02-03, 2022-08-11. [GDExtension] operators unary-/unary+ unavialable in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into a specific case today. A user reported incorrect behavior, but the log gives no help in tracking down the problem. I’ve written a patch which just adds the exception’s own message and location to the single line log entry. I agree that we don’t want a stack trace for every 404.
There is already a set LOG_AS_ERROR containing the single status 422. This could be filled from configuration instead of a static assignment. Members of LOG_AS_ERROR get a stack trace. All 500-class statuses are already treated this way.