共用方式為


EnrichmentServiceCollectionExtensions.AddLogEnricher 方法

定義

多載

AddLogEnricher(IServiceCollection, ILogEnricher)

註冊記錄擴充器實例。

AddLogEnricher<T>(IServiceCollection)

註冊記錄擴充器類型。

AddLogEnricher(IServiceCollection, ILogEnricher)

來源:
EnrichmentServiceCollectionExtensions.cs
來源:
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)

來源:
EnrichmentServiceCollectionExtensions.cs
來源:
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

適用於