HttpClientLoggingHttpClientBuilderExtensions.AddExtendedHttpClientLogging Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
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
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
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)
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
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- 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>)
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
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- 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.