Delen via


HttpClientLoggingHttpClientBuilderExtensions.AddExtendedHttpClientLogging Method

Definition

Overloads

AddExtendedHttpClientLogging(IHttpClientBuilder)

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named HttpClient.

AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection)

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named HttpClient.

AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>)

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named HttpClient.

AddExtendedHttpClientLogging(IHttpClientBuilder)

Source:
HttpClientLoggingHttpClientBuilderExtensions.cs

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named 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

Parameters

Returns

The value of builder.

Exceptions

Argument builder is null.

Remarks

All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). A lot of the information logged by this method (like bodies, methods, host, path, and duration) will be added as enrichment tags to the structured log. Make sure you have a way of viewing structured logs in order to view this extra information.

Applies to

AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection)

Source:
HttpClientLoggingHttpClientBuilderExtensions.cs

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named 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

Parameters

section
IConfigurationSection

The IConfigurationSection to use for configuring LoggingOptions.

Returns

The value of builder.

Exceptions

Any of the arguments is null.

Remarks

All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). A lot of the information logged by this method (like bodies, methods, host, path, and duration) will be added as enrichment tags to the structured log. Make sure you have a way of viewing structured logs in order to view this extra information.

Applies to

AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>)

Source:
HttpClientLoggingHttpClientBuilderExtensions.cs

Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named 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

Parameters

configure
Action<LoggingOptions>

The delegate to configure LoggingOptions with.

Returns

The value of builder.

Exceptions

Any of the arguments is null.

Remarks

All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). A lot of the information logged by this method (like bodies, methods, host, path, and duration) will be added as enrichment tags to the structured log. Make sure you have a way of viewing structured logs in order to view this extra information.

Applies to