Compartir a través de


HttpClientBuilderExtensions.RedactLoggedHeaders Method

Definition

Overloads

RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)

Sets the collection of HTTP headers names for which values should be redacted before logging.

RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)

Sets the Func<T,TResult> which determines whether to redact the HTTP header value given its corresponding header name before logging.

RedactLoggedHeaders(IHttpClientBuilder, IEnumerable<String>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

Sets the collection of HTTP headers names for which values should be redacted before logging.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ RedactLoggedHeaders(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, System::Collections::Generic::IEnumerable<System::String ^> ^ redactedLoggedHeaderNames);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder RedactLoggedHeaders (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, System.Collections.Generic.IEnumerable<string> redactedLoggedHeaderNames);
static member RedactLoggedHeaders : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * seq<string> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function RedactLoggedHeaders (builder As IHttpClientBuilder, redactedLoggedHeaderNames As IEnumerable(Of String)) As IHttpClientBuilder

Parameters

redactedLoggedHeaderNames
IEnumerable<String>

The collection of HTTP headers names for which values should be redacted before logging.

Returns

The IHttpClientBuilder.

Applies to

RedactLoggedHeaders(IHttpClientBuilder, Func<String,Boolean>)

Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs
Source:
HttpClientBuilderExtensions.cs

Sets the Func<T,TResult> which determines whether to redact the HTTP header value given its corresponding header name before logging.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ RedactLoggedHeaders(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Func<System::String ^, bool> ^ shouldRedactHeaderValue);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder RedactLoggedHeaders (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Func<string,bool> shouldRedactHeaderValue);
static member RedactLoggedHeaders : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Func<string, bool> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function RedactLoggedHeaders (builder As IHttpClientBuilder, shouldRedactHeaderValue As Func(Of String, Boolean)) As IHttpClientBuilder

Parameters

shouldRedactHeaderValue
Func<String,Boolean>

The Func<T,TResult> which determines whether to redact the HTTP header value given its corresponding header name before logging.

Returns

The IHttpClientBuilder.

Remarks

The provided shouldRedactHeaderValue predicate will be evaluated for each header name when logging. If the predicate returns true then the header value will be replaced with a marker value * in logs; otherwise the header value will be logged.

Applies to