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