HttpClientLoggingExtensions.AddDefaultHttpClientLogging 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
AddDefaultHttpClientLogging(IServiceCollection) |
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory. |
AddDefaultHttpClientLogging(IServiceCollection, IConfigurationSection) |
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory. |
AddDefaultHttpClientLogging(IServiceCollection, Action<LoggingOptions>) |
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory. |
AddDefaultHttpClientLogging(IServiceCollection)
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDefaultHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDefaultHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddDefaultHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDefaultHttpClientLogging (services As IServiceCollection) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection.
Returns
IServiceCollection instance for chaining.
Exceptions
Argument services
is null
.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder).
Applies to
AddDefaultHttpClientLogging(IServiceCollection, IConfigurationSection)
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDefaultHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Configuration::IConfigurationSection ^ section);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDefaultHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddDefaultHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDefaultHttpClientLogging (services As IServiceCollection, section As IConfigurationSection) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection.
- section
- IConfigurationSection
The IConfigurationSection to use for configuring LoggingOptions.
Returns
IServiceCollection instance for chaining.
Exceptions
Any of the arguments is null
.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder).
Applies to
AddDefaultHttpClientLogging(IServiceCollection, Action<LoggingOptions>)
Adds an IHttpClientAsyncLogger to emit logs for outgoing requests for all HTTP clients created with IHttpClientFactory.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddDefaultHttpClientLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Http::Telemetry::Logging::LoggingOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddDefaultHttpClientLogging(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Http.Telemetry.Logging.LoggingOptions> configure);
static member AddDefaultHttpClientLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Http.Telemetry.Logging.LoggingOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddDefaultHttpClientLogging (services As IServiceCollection, configure As Action(Of LoggingOptions)) As IServiceCollection
Parameters
- services
- IServiceCollection
The IServiceCollection.
- configure
- Action<LoggingOptions>
The delegate to configure LoggingOptions with.
Returns
IServiceCollection instance for chaining.
Exceptions
Any of the arguments is null
.
Remarks
All other loggers are removed - including the default one, registered via AddDefaultLogger(IHttpClientBuilder).