-
Notifications
You must be signed in to change notification settings - Fork 824
Open
Labels
Description
**Suppressing specific headers is cumbersome **
Certain headers should probably not be logged, e.g., Authorization.
Add configuration properties to include/exclude headers
Add the following list configurations:
spring.cloud.openfeign.client.config.name.headers.request.includespring.cloud.openfeign.client.config.name.headers.request.excludespring.cloud.openfeign.client.config.name.headers.response.includespring.cloud.openfeign.client.config.name.headers.response.exclude
The expected behavior would be to exclude any header in the exclude list, and only show header in the include list if any are present.
Alternatives: Making a custom component
@Component
class MyFeignLoggerFactory implements FeignLoggerFactory {
@Override
public Logger create(Class<?> type) {
return new Slf4jLogger(type) {
@Override
protected boolean shouldLogRequestHeader(String header) {
return !"Authorization".equals(header);
}
};
}
}
Reactions are currently unavailable