EnrichmentServiceCollectionExtensions.AddStaticLogEnricher Method

Definition

Overloads

AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher)

Registers a static log enricher instance.

AddStaticLogEnricher<T>(IServiceCollection)

Registers a static log enricher type.

AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher)

Source:
EnrichmentServiceCollectionExtensions.cs

Registers a static log enricher instance.

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStaticLogEnricher(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher enricher);

Parameters

services
IServiceCollection

The dependency injection container to add the enricher instance to.

enricher
IStaticLogEnricher

The enricher instance to add.

Returns

The value of services.

Exceptions

services or enricher is null.

Applies to

.NET 10 (package-provided) és más verziók
Termék Verziók
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)

AddStaticLogEnricher<T>(IServiceCollection)

Source:
EnrichmentServiceCollectionExtensions.cs

Registers a static log enricher type.

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStaticLogEnricher<T>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher;

Type Parameters

T

Enricher type.

Parameters

services
IServiceCollection

The dependency injection container to add the enricher type to.

Returns

The value of services.

Exceptions

services is null.

Applies to

.NET 10 (package-provided) és más verziók
Termék Verziók
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)