You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for filing this — the pain point is real and the scope is nicely self-contained, which fits well given this project only takes small, additive community PRs at this point.
A few thoughts before diving into implementation:
Simplify the property surface. The primary use case here is hiding sensitive headers (Authorization, tokens, etc.), not selective allow-listing. A single exclude-only list — spring.cloud.openfeign.client.config..logging.sensitive-headers — would cover that need without the precedence ambiguity an include+exclude combo introduces (what happens if a header is in both lists? does include override a global exclude?). If there's a concrete use case for include-lists too, happy to hear it, but I'd start minimal and extend later if needed.
Implementation sketch. This would plug in similarly to how default-request-headers is already resolved per client in FeignClientProperties — a custom Logger/FeignLoggerFactory extending Slf4jLogger, overriding shouldLogRequestHeader/shouldLogResponseHeader, populated from the resolved config instead of requiring a hand-rolled bean.
One caveat worth documenting. Even with header suppression in place, FULL logging mode can still leak header-like data embedded in the raw request/response body dump (see OpenFeign/feign#2586). Worth calling that out in the docs so this doesn't get treated as a complete guarantee.
Happy to put together a PR once there's agreement on exclude-only vs. include+exclude — let me know which direction you'd prefer.
Activity
PRAHLAD09-dev commentedon Aug 5, 2026
Thanks for filing this — the pain point is real and the scope is nicely self-contained, which fits well given this project only takes small, additive community PRs at this point.
A few thoughts before diving into implementation:
Simplify the property surface. The primary use case here is hiding sensitive headers (Authorization, tokens, etc.), not selective allow-listing. A single exclude-only list — spring.cloud.openfeign.client.config..logging.sensitive-headers — would cover that need without the precedence ambiguity an include+exclude combo introduces (what happens if a header is in both lists? does include override a global exclude?). If there's a concrete use case for include-lists too, happy to hear it, but I'd start minimal and extend later if needed.
Implementation sketch. This would plug in similarly to how default-request-headers is already resolved per client in FeignClientProperties — a custom Logger/FeignLoggerFactory extending Slf4jLogger, overriding shouldLogRequestHeader/shouldLogResponseHeader, populated from the resolved config instead of requiring a hand-rolled bean.
One caveat worth documenting. Even with header suppression in place, FULL logging mode can still leak header-like data embedded in the raw request/response body dump (see OpenFeign/feign#2586). Worth calling that out in the docs so this doesn't get treated as a complete guarantee.
Happy to put together a PR once there's agreement on exclude-only vs. include+exclude — let me know which direction you'd prefer.
jkstrauss commentedon Aug 5, 2026
@PRAHLAD09-dev I like your simplified solution. Just have sensitive-headers list.
yashdotdev13 commentedon Nov 12, 2026
Hi @ryanjbaxter, @spencergibb I have opened PR #1458 implementing the exclude-only
sensitive-headersconfiguration as discussed.The implementation supports:
LoggerandFeignLoggerFactorybehavior.I have also added tests, configuration metadata, and documentation. All six
FeignLoggerFactoryTestspass, and formatting validation succeeds.Feedback and suggestions are welcome. Thanks for the guidance!