EnrichmentServiceCollectionExtensions.AddLogEnricher 方法

定义

重载

AddLogEnricher(IServiceCollection, ILogEnricher)

注册日志扩充器实例。

AddLogEnricher<T>(IServiceCollection)

注册日志扩充器类型。

AddLogEnricher(IServiceCollection, ILogEnricher)

Source:
EnrichmentServiceCollectionExtensions.cs

注册日志扩充器实例。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddLogEnricher(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Diagnostics::Enrichment::ILogEnricher ^ enricher);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLogEnricher (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Diagnostics.Enrichment.ILogEnricher enricher);
static member AddLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Diagnostics.Enrichment.ILogEnricher -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddLogEnricher (services As IServiceCollection, enricher As ILogEnricher) As IServiceCollection

参数

services
IServiceCollection

要向其添加扩充器实例的依赖项注入容器。

enricher
ILogEnricher

要添加的扩充器实例。

返回

services 的值。

例外

servicesenrichernull

适用于

AddLogEnricher<T>(IServiceCollection)

Source:
EnrichmentServiceCollectionExtensions.cs

注册日志扩充器类型。

public:
generic <typename T>
 where T : class, Microsoft::Extensions::Diagnostics::Enrichment::ILogEnricher[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddLogEnricher(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddLogEnricher<T> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.Extensions.Diagnostics.Enrichment.ILogEnricher;
static member AddLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'T : null and 'T :> Microsoft.Extensions.Diagnostics.Enrichment.ILogEnricher)
<Extension()>
Public Function AddLogEnricher(Of T As {Class, ILogEnricher}) (services As IServiceCollection) As IServiceCollection

类型参数

T

扩充器类型。

参数

services
IServiceCollection

要向其添加扩充器类型的依赖项注入容器。

返回

services 的值。

例外

servicesnull

适用于