HttpLoggingServiceExtensions.AddHttpLogging 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddHttpLogging(IServiceCollection) |
將傳入 HTTP 要求的元件新增至 IServiceCollection 。 |
AddHttpLogging(IServiceCollection, IConfigurationSection) |
將傳入 HTTP 要求的元件新增至 IServiceCollection 。 |
AddHttpLogging(IServiceCollection, Action<LoggingOptions>) |
將傳入 HTTP 要求的元件新增至 IServiceCollection 。 |
AddHttpLogging(IServiceCollection)
將傳入 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,以便鏈結其他呼叫。
例外狀況
services
為 null
。
適用於
AddHttpLogging(IServiceCollection, IConfigurationSection)
將傳入 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,以便鏈結其他呼叫。
例外狀況
services
或 section
是 null
。
適用於
AddHttpLogging(IServiceCollection, Action<LoggingOptions>)
將傳入 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>
設定 LoggingOptions 的 Action<T>。
傳回
IServiceCollection,以便鏈結其他呼叫。
例外狀況
services
或 configure
是 null
。