feign icon indicating copy to clipboard operation
feign copied to clipboard

shouldLogRequestHeader and shouldLogResponseHeader is not enough to control headers log in FULL mode

Open peterszatmary opened this issue 4 months ago • 0 comments

There is an implementation to control request and response headers with shouldLogRequestHeader and shouldLogResponseHeader.

It's working for logs but …

There is a line in the implementation which logs the whole response body also with headers.

I would also like to control these headers. Filter out particular headers in that particular log.

I am using FULL logging and debug mode.

The reason why I filter out the headers is to avoid security sensitive headers like tokens etc.

I would like to see that shouldLogResponseHeader is controlling also this line of the log too without any other implementation.

Here is how the log looks like

-10-04T10:36:50.206+02:00 DEBUG 131409 --- [demo] [           main] feign.Logger                             : [Client#get] {

  "args": {},

  "headers": {

    "Accept": "*/*",

    "Host": "[httpbin.org](http://httpbin.org/)",

    "User-Agent": "Java/21.0.1",

    "X-Amzn-Trace-Id": "Root=1-66ffa922-324f4c83482b70b4579853ac"

  },

  "origin": "88.212.19.236",

  "url": "https://httpbin.org/get"
}

peterszatmary avatar Oct 06 '24 20:10 peterszatmary