Skip to content

HttpLogging exclude redacted headers from logging #62876

@ramil-mux

Description

@ramil-mux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions