EnrichmentServiceCollectionExtensions.AddStaticLogEnricher 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher) |
註冊靜態記錄擴充器實例。 |
AddStaticLogEnricher<T>(IServiceCollection) |
註冊靜態記錄擴充器類型。 |
AddStaticLogEnricher(IServiceCollection, IStaticLogEnricher)
註冊靜態記錄擴充器實例。
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
參數
- services
- IServiceCollection
要加入擴充器實例的相依性插入容器。
- enricher
- IStaticLogEnricher
要加入的擴充器實例。
傳回
services
的值。
例外狀況
services
或 enricher
為 null
。
適用於
AddStaticLogEnricher<T>(IServiceCollection)
註冊靜態記錄擴充器類型。
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
類型參數
- T
擴充器類型。
參數
- services
- IServiceCollection
要加入擴充器類型的相依性插入容器。
傳回
services
的值。
例外狀況
services
為 null
。