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
| Name | Description |
|---|---|
| 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, Boolean) |
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named HttpClient. |
| AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection, Boolean) |
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for a named HttpClient. |
| AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>, Boolean) |
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). Information logged by this method is added as key/value pairs to log state.
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). Information logged by this method is added as key/value pairs to log state.
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). Information logged by this method is added as key/value pairs to log state.
Applies to
AddExtendedHttpClientLogging(IHttpClientBuilder, Boolean)
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, bool wrapHandlersPipeline);
[System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, bool wrapHandlersPipeline);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, bool wrapHandlersPipeline);
[<System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder, wrapHandlersPipeline As Boolean) As IHttpClientBuilder
Parameters
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- wrapHandlersPipeline
- Boolean
When true, the logger is placed at the beginning of the request pipeline, wrapping all other handlers.
When false, the logger is placed at the end of the pipeline, right before the primary message handler.
Returns
The value of builder.
- Attributes
Exceptions
Argument builder is null.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). Information logged by this method is added as key/value pairs to log state.
Applies to
AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection, Boolean)
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, bool wrapHandlersPipeline);
[System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Microsoft.Extensions.Configuration.IConfigurationSection section, bool wrapHandlersPipeline);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Microsoft.Extensions.Configuration.IConfigurationSection section, bool wrapHandlersPipeline);
[<System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Microsoft.Extensions.Configuration.IConfigurationSection * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Microsoft.Extensions.Configuration.IConfigurationSection * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder, section As IConfigurationSection, wrapHandlersPipeline As Boolean) As IHttpClientBuilder
Parameters
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- section
- IConfigurationSection
The IConfigurationSection to use for configuring LoggingOptions.
- wrapHandlersPipeline
- Boolean
When true, the logger is placed at the beginning of the request pipeline, wrapping all other handlers.
When false, the logger is placed at the end of the pipeline, right before the primary message handler.
Returns
The value of builder.
- Attributes
Exceptions
Any of the arguments is null.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). Information logged by this method is added as key/value pairs to log state.
Applies to
AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>, Boolean)
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, bool wrapHandlersPipeline);
[System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")]
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Action<Microsoft.Extensions.Http.Logging.LoggingOptions> configure, bool wrapHandlersPipeline);
public static Microsoft.Extensions.DependencyInjection.IHttpClientBuilder AddExtendedHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IHttpClientBuilder builder, Action<Microsoft.Extensions.Http.Logging.LoggingOptions> configure, bool wrapHandlersPipeline);
[<System.Diagnostics.CodeAnalysis.Experimental("EXTEXP0003", UrlFormat="https://aka.ms/dotnet-extensions-warnings/{0}")>]
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Action<Microsoft.Extensions.Http.Logging.LoggingOptions> * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
static member AddExtendedHttpClientLogging : Microsoft.Extensions.DependencyInjection.IHttpClientBuilder * Action<Microsoft.Extensions.Http.Logging.LoggingOptions> * bool -> Microsoft.Extensions.DependencyInjection.IHttpClientBuilder
<Extension()>
Public Function AddExtendedHttpClientLogging (builder As IHttpClientBuilder, configure As Action(Of LoggingOptions), wrapHandlersPipeline As Boolean) As IHttpClientBuilder
Parameters
- builder
- IHttpClientBuilder
The IHttpClientBuilder.
- configure
- Action<LoggingOptions>
The delegate to configure LoggingOptions with.
- wrapHandlersPipeline
- Boolean
When true, the logger is placed at the beginning of the request pipeline, wrapping all other handlers.
When false, the logger is placed at the end of the pipeline, right before the primary message handler.
Returns
The value of builder.
- Attributes
Exceptions
Any of the arguments is null.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder). Information logged by this method is added as key/value pairs to log state.