HttpClientLoggingExtensions.AddHttpClientLogEnricher<T> Method

Definition

Adds an enricher instance of T to the IServiceCollection to enrich HttpClient logs.

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpClientLogEnricher<T>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.Extensions.Http.Telemetry.Logging.IHttpClientLogEnricher;

Type Parameters

T

Type of enricher.

Parameters

services
IServiceCollection

The IServiceCollection to add the instance of T to.

Returns

The IServiceCollection so that additional calls can be chained.

Applies to

Product Versions
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided), 10 (package-provided)