Dela via


HttpLoggingServiceExtensions.AddHttpLogEnricher<T> Method

Definition

Adds an enricher instance of T to the IServiceCollection to enrich incoming HTTP requests logs.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLogEnricher<T> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.AspNetCore.Telemetry.IHttpLogEnricher;
static member AddHttpLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'T : null and 'T :> Microsoft.AspNetCore.Telemetry.IHttpLogEnricher)
<Extension()>
Public Function AddHttpLogEnricher(Of T As {Class, IHttpLogEnricher}) (services As IServiceCollection) As IServiceCollection

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.

Exceptions

services is null.

Applies to