HttpClientLoggingHttpClientBuilderExtensions.AddExtendedHttpClientLogging 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddExtendedHttpClientLogging(IHttpClientBuilder) |
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。 |
AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection) |
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。 |
AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>) |
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。 |
AddExtendedHttpClientLogging(IHttpClientBuilder)
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
返回
builder
的值。
例外
参数 builder
为 null
。
注解
删除所有其他记录器,包括通过 AddDefaultLogger(IHttpClientBuilder)注册的默认记录器。 此方法记录的大量信息 (如正文、方法、主机、路径和持续时间) 将作为扩充标记添加到结构化日志。 确保有查看结构化日志的方法,以便查看此额外信息。
适用于
AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection)
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Microsoft::Extensions::Configuration::IConfigurationSection ^ section);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder, section As IConfigurationSection) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
- section
- IConfigurationSection
IConfigurationSection要用于配置 LoggingOptions的 。
返回
builder
的值。
例外
任何参数为 null
。
注解
删除所有其他记录器,包括通过 AddDefaultLogger(IHttpClientBuilder)注册的默认记录器。 此方法记录的大量信息 (如正文、方法、主机、路径和持续时间) 将作为扩充标记添加到结构化日志。 确保有查看结构化日志的方法,以便查看此额外信息。
适用于
AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>)
添加 , IHttpClientAsyncLogger 以便为名为 HttpClient的 发出传出请求的日志。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ AddExtendedHttpClientLogging(Microsoft::Extensions::DependencyInjection::IHttpClientBuilder ^ builder, Action<Microsoft::Extensions::Http::Logging::LoggingOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging (this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Action<Microsoft.Extensions.Http.Logging.LoggingOptions> configure);
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Action<Microsoft.Extensions.Http.Logging.LoggingOptions> -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder, configure As Action(Of LoggingOptions)) As IHttpClientBuilder
参数
- builder
- IHttpClientBuilder
- configure
- Action<LoggingOptions>
要配置的 LoggingOptions 委托。
返回
builder
的值。
例外
任何参数为 null
。
注解
删除所有其他记录器,包括通过 AddDefaultLogger(IHttpClientBuilder)注册的默认记录器。 此方法记录的大量信息 (如正文、方法、主机、路径和持续时间) 将作为扩充标记添加到结构化日志。 确保有查看结构化日志的方法,以便查看此额外信息。