question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DSpaceApiExceptionControllerAdvice logs nothing of interest

See original GitHub issue

Describe 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:

  1. Trigger a 404 response.
  2. 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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoodiupuicommented, Feb 3, 2022

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.

0reactions
mwoodiupuicommented, Feb 7, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found