HttpClientBuilderExtensions.RedactLoggedHeaders Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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>)
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
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- 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>)
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
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
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
.NET