HttpClientLoggingServiceCollectionExtensions.AddExtendedHttpClientLogging 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddExtendedHttpClientLogging(IServiceCollection) |
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。 |
AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection) |
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。 |
AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>) |
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。 |
AddExtendedHttpClientLogging(IServiceCollection)
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddExtendedHttpClientLogging (services As IServiceCollection) As IServiceCollection
參數
- services
- IServiceCollection
傳回
services
的值。
例外狀況
自變數 services
為 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。
適用於
AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Configuration::IConfigurationSection ^ section);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddExtendedHttpClientLogging (services As IServiceCollection, section As IConfigurationSection) As IServiceCollection
參數
- services
- IServiceCollection
- section
- IConfigurationSection
傳回
services
的值。
例外狀況
任何自變數都是 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。
適用於
AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)
針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Http::Logging::LoggingOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Http.Logging.LoggingOptions> configure);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Http.Logging.LoggingOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddExtendedHttpClientLogging (services As IServiceCollection, configure As Action(Of LoggingOptions)) As IServiceCollection
參數
- services
- IServiceCollection
- configure
- Action<LoggingOptions>
要 LoggingOptions 設定的委派。
傳回
services
的值。
例外狀況
任何自變數都是 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。