EnrichmentServiceCollectionExtensions.AddStaticLogEnricher Method
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.
AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher) |
Registers a static log enricher instance. |
AddStaticLogEnricher<T>(IServiceCollection) |
Registers a static log enricher type. |
Registers a static log enricher instance.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddStaticLogEnricher(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Diagnostics::Enrichment::IStaticLogEnricher ^ enricher);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStaticLogEnricher(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher enricher);
static member AddStaticLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddStaticLogEnricher (services As IServiceCollection, enricher As IStaticLogEnricher) As IServiceCollection
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) |
Registers a static log enricher type.
public:
generic <typename T>
where T : class, Microsoft::Extensions::Diagnostics::Enrichment::IStaticLogEnricher[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddStaticLogEnricher(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddStaticLogEnricher<T>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher;
static member AddStaticLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'T : null and 'T :> Microsoft.Extensions.Diagnostics.Enrichment.IStaticLogEnricher)
<Extension()>
Public Function AddStaticLogEnricher(Of T As {Class, IStaticLogEnricher}) (services As IServiceCollection) As IServiceCollection
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) |
.NET-visszajelzés
A(z) .NET egy nyílt forráskód projekt. Visszajelzés adásához válasszon egy hivatkozást: