HttpClientLoggingHttpClientBuilderExtensions.AddExtendedHttpClientLogging 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddExtendedHttpClientLogging(IHttpClientBuilder)
加入 , IHttpClientAsyncLogger 以針對具名 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
參數
- builder
- IHttpClientBuilder
傳回
builder
的值。
例外狀況
自變數 builder
為 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。 這個方法所記錄的許多資訊 (,例如主體、方法、主機、路徑和持續時間) ,都會新增為結構化記錄檔的擴充標記。 請確定您有檢視結構化記錄的方式,才能檢視這項額外資訊。
適用於
AddExtendedHttpClientLogging(IHttpClientBuilder, IConfigurationSection)
加入 , IHttpClientAsyncLogger 以針對具名 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
參數
- builder
- IHttpClientBuilder
- section
- IConfigurationSection
傳回
builder
的值。
例外狀況
任何自變數都是 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。 這個方法所記錄的許多資訊 (,例如主體、方法、主機、路徑和持續時間) ,都會新增為結構化記錄檔的擴充標記。 請確定您有檢視結構化記錄的方式,才能檢視這項額外資訊。
適用於
AddExtendedHttpClientLogging(IHttpClientBuilder, Action<LoggingOptions>)
加入 , IHttpClientAsyncLogger 以針對具名 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
參數
- builder
- IHttpClientBuilder
- configure
- Action<LoggingOptions>
要 LoggingOptions 設定的委派。
傳回
builder
的值。
例外狀況
任何自變數都是 null
。
備註
會移除所有其他記錄器,包括透過 AddDefaultLogger(IHttpClientBuilder)註冊的默認記錄器。 這個方法所記錄的許多資訊 (,例如主體、方法、主機、路徑和持續時間) ,都會新增為結構化記錄檔的擴充標記。 請確定您有檢視結構化記錄的方式,才能檢視這項額外資訊。