共用方式為


HttpClientLoggingServiceCollectionExtensions.AddExtendedHttpClientLogging 方法

定義

多載

AddExtendedHttpClientLogging(IServiceCollection)

針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。

AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)

針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。

AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)

針對使用 IHttpClientFactory建立的所有 HTTP 用戶端,新增 以IHttpClientAsyncLogger發出傳出要求的記錄。

AddExtendedHttpClientLogging(IServiceCollection)

來源:
HttpClientLoggingServiceCollectionExtensions.cs

針對使用 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 的值。

例外狀況

自變數 servicesnull

備註

會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。

適用於

AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)

來源:
HttpClientLoggingServiceCollectionExtensions.cs

針對使用 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 的值。

例外狀況

任何自變數都是 null

備註

會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。

適用於

AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)

來源:
HttpClientLoggingServiceCollectionExtensions.cs

針對使用 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

參數

configure
Action<LoggingOptions>

LoggingOptions 設定的委派。

傳回

services 的值。

例外狀況

任何自變數都是 null

備註

會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。

適用於