HttpClientLoggingServiceCollectionExtensions.AddExtendedHttpClientLogging 方法

定义

重载

AddExtendedHttpClientLogging(IServiceCollection)

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

AddExtendedHttpClientLogging(IServiceCollection)

Source:
HttpClientLoggingServiceCollectionExtensions.cs

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

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)

Source:
HttpClientLoggingServiceCollectionExtensions.cs

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

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>)

Source:
HttpClientLoggingServiceCollectionExtensions.cs

添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。

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)注册。

适用于