dotnet / dotnet/aspnetcore

HttpLogging exclude redacted headers from logging

Open
#62,876 4 comments 0 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

I want to log my http request and response, but i want log only body and only my headers.
For example, i don't want log Accept header, or Connection header, i want log only X-USER-ID header. Today, if I choose `LoggingFields = HttpLoggingFields.RequestBody | HttpLoggingFields.RequestHeaders;` i see in logs headers with Redacted value. I want to exclude them from log.
How can i do this scenario?

Using .NET 9

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.