ZCU-PUB/Reduce warn logs noise - 404 dedicated logger#1276
Open
milanmajchrak wants to merge 1 commit intocustomer/zcu-pubfrom
Open
ZCU-PUB/Reduce warn logs noise - 404 dedicated logger#1276milanmajchrak wants to merge 1 commit intocustomer/zcu-pubfrom
milanmajchrak wants to merge 1 commit intocustomer/zcu-pubfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces REST API log noise by routing expected 404 NOT_FOUND client errors to a dedicated Log4j2 logger which is OFF by default, and refactors error logging logic in the REST exception controller advice to centralize 4xx/5xx logging decisions.
Changes:
- Add a dedicated
...DSpaceApiExceptionControllerAdvice.NotFoundlogger (OFF by default) intended to suppress expected 404 warnings. - Refactor REST exception logging by extracting
getStatusCodesLoggedAsErrors()andlogClientError()helpers. - Introduce
sendErrorResponseFromException()helper (currently not wired into any handler).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
dspace/config/log4j2.xml |
Adds a dedicated OFF-by-default logger for 404 responses to suppress expected 404 warnings. |
dspace-server-webapp/src/main/java/org/dspace/app/rest/exception/DSpaceApiExceptionControllerAdvice.java |
Adds a 404-dedicated logger and refactors client-error logging into helper methods. |
You can also share your feedback on Copilot code review. Take the survey.
...r-webapp/src/main/java/org/dspace/app/rest/exception/DSpaceApiExceptionControllerAdvice.java
Outdated
Show resolved
Hide resolved
...r-webapp/src/main/java/org/dspace/app/rest/exception/DSpaceApiExceptionControllerAdvice.java
Outdated
Show resolved
Hide resolved
...r-webapp/src/main/java/org/dspace/app/rest/exception/DSpaceApiExceptionControllerAdvice.java
Outdated
Show resolved
Hide resolved
4c3af68 to
461cc12
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of commits 1dc5339 and db67645 into customer/zcu-pub.
Problem description
Original commits: