Skip to content

ZCU-PUB/Reduce warn logs noise - 404 dedicated logger#1276

Open
milanmajchrak wants to merge 1 commit intocustomer/zcu-pubfrom
propagate/reduce-warn-logs-v2-zcu-pub
Open

ZCU-PUB/Reduce warn logs noise - 404 dedicated logger#1276
milanmajchrak wants to merge 1 commit intocustomer/zcu-pubfrom
propagate/reduce-warn-logs-v2-zcu-pub

Conversation

@milanmajchrak
Copy link
Collaborator

Cherry-pick of commits 1dc5339 and db67645 into customer/zcu-pub.

Problem description

  • Log 404 responses via dedicated Log4j2 logger (org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice.NotFound) set to OFF by default
  • Extract getStatusCodesLoggedAsErrors() and logClientError() helper methods
  • Add sendErrorResponseFromException() for 4xx errors
  • Fix row length to be less than 120 chars

Original commits:

Copilot AI review requested due to automatic review settings March 13, 2026 14:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.NotFound logger (OFF by default) intended to suppress expected 404 warnings.
  • Refactor REST exception logging by extracting getStatusCodesLoggedAsErrors() and logClientError() 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.

@milanmajchrak milanmajchrak changed the title Reduce warn logs noise - 404 dedicated logger ZCU-PUB/Reduce warn logs noise - 404 dedicated logger Mar 13, 2026
@milanmajchrak milanmajchrak force-pushed the propagate/reduce-warn-logs-v2-zcu-pub branch from 4c3af68 to 461cc12 Compare March 13, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants