共用方式為


HttpLoggingServiceExtensions.AddHttpLogging 方法

定義

多載

AddHttpLogging(IServiceCollection)

將傳入 HTTP 要求的元件新增至 IServiceCollection

AddHttpLogging(IServiceCollection, IConfigurationSection)

將傳入 HTTP 要求的元件新增至 IServiceCollection

AddHttpLogging(IServiceCollection, Action<LoggingOptions>)

將傳入 HTTP 要求的元件新增至 IServiceCollection

AddHttpLogging(IServiceCollection)

來源:
HttpLoggingServiceExtensions.cs

將傳入 HTTP 要求的元件新增至 IServiceCollection

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddHttpLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddHttpLogging (services As IServiceCollection) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

傳回

IServiceCollection,以便鏈結其他呼叫。

例外狀況

servicesnull

適用於

AddHttpLogging(IServiceCollection, IConfigurationSection)

來源:
HttpLoggingServiceExtensions.cs

將傳入 HTTP 要求的元件新增至 IServiceCollection

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddHttpLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddHttpLogging (services As IServiceCollection, section As IConfigurationSection) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

section
IConfigurationSection

要系結 LoggingOptions 至的組態區段。

傳回

IServiceCollection,以便鏈結其他呼叫。

例外狀況

servicessectionnull

適用於

AddHttpLogging(IServiceCollection, Action<LoggingOptions>)

來源:
HttpLoggingServiceExtensions.cs

將傳入 HTTP 要求的元件新增至 IServiceCollection

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddHttpLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Telemetry.LoggingOptions> configure);
static member AddHttpLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Telemetry.LoggingOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddHttpLogging (services As IServiceCollection, configure As Action(Of LoggingOptions)) As IServiceCollection

參數

services
IServiceCollection

要新增服務的 IServiceCollection

configure
Action<LoggingOptions>

設定 LoggingOptionsAction<T>

傳回

IServiceCollection,以便鏈結其他呼叫。

例外狀況

servicesconfigurenull

適用於