HttpClientLoggingServiceCollectionExtensions.AddExtendedHttpClientLogging 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddExtendedHttpClientLogging(IServiceCollection) |
添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。 |
AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection) |
添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。 |
AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>) |
添加 , IHttpClientAsyncLogger 以针对使用 IHttpClientFactory创建的所有 HTTP 客户端发出传出请求的日志。 |
AddExtendedHttpClientLogging(IServiceCollection)
添加 , 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
- IServiceCollection
返回
services
的值。
例外
参数 services
为 null
。
注解
删除所有其他记录器 - 包括默认记录器,通过 AddDefaultLogger(IHttpClientBuilder)注册。
适用于
AddExtendedHttpClientLogging(IServiceCollection, IConfigurationSection)
添加 , 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
- IServiceCollection
- section
- IConfigurationSection
IConfigurationSection要用于配置 LoggingOptions的 。
返回
services
的值。
例外
任何参数都是 null
。
注解
删除所有其他记录器 - 包括默认记录器,通过 AddDefaultLogger(IHttpClientBuilder)注册。
适用于
AddExtendedHttpClientLogging(IServiceCollection, Action<LoggingOptions>)
添加 , 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
参数
- services
- IServiceCollection
- configure
- Action<LoggingOptions>
要配置的 LoggingOptions 委托。
返回
services
的值。
例外
任何参数都是 null
。
注解
删除所有其他记录器 - 包括默认记录器,通过 AddDefaultLogger(IHttpClientBuilder)注册。