Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-12760

RestTemplate logging for 404 status code

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.1.5
    • Fix Version/s: 4.1.6, 4.2 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I would like to reduce the log level of 404 (NOT FOUND) from WARN to INFO or DEBUG, while still treating it as an error (still have an HttpClientErrorException thrown).

      I don't want to set the log level to ERROR because we do want to see WARNs for other errors.

      We have added code to XD's admin to clean up rabbitmq using it's REST API. We have to look up several resources to see if they are eligible to be deleted and it is normal that some resource(s) might not be present.

      At the moment this causes a bunch of WARN logs to be emitted.

      I could, of course, use a custom ResponseErrorHandler and handle 404s differently but that would add a fair amount more complexity to the code.

      One solution might be to widen handleResponseError to protected so I can control the logging myself, but I am open to other ideas.

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              grussell Gary Russell
              Last updater:
              Spring Issuemaster
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                31 weeks, 3 days ago