共用方式為


HttpLoggingServiceExtensions.AddHttpLogEnricher<T> 方法

定義

將 的 T 擴充器實例新增至 , IServiceCollection 以擴充傳入的 HTTP 要求記錄。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLogEnricher<T> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where T : class, Microsoft.AspNetCore.Telemetry.IHttpLogEnricher;
static member AddHttpLogEnricher : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'T : null and 'T :> Microsoft.AspNetCore.Telemetry.IHttpLogEnricher)
<Extension()>
Public Function AddHttpLogEnricher(Of T As {Class, IHttpLogEnricher}) (services As IServiceCollection) As IServiceCollection

類型參數

T

擴充器的類型。

參數

services
IServiceCollection

IServiceCollection 加入 實例的 T

傳回

IServiceCollection,以便鏈結其他呼叫。

例外狀況

servicesnull

適用於