WebHostBuilderExtensions.ConfigureLogging 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>) |
新增用於設定所提供 LoggerFactory 的委派。 可能會多次呼叫此項。 |
ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>) |
新增用於設定所提供 ILoggingBuilder 的委派。 可能會多次呼叫此項。 |
ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>)
新增用於設定所提供 LoggerFactory 的委派。 可能會多次呼叫此項。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ ConfigureLogging(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, Action<Microsoft::AspNetCore::Hosting::WebHostBuilderContext ^, Microsoft::Extensions::Logging::ILoggingBuilder ^> ^ configureLogging);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder ConfigureLogging (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Action<Microsoft.AspNetCore.Hosting.WebHostBuilderContext,Microsoft.Extensions.Logging.ILoggingBuilder> configureLogging);
static member ConfigureLogging : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Action<Microsoft.AspNetCore.Hosting.WebHostBuilderContext, Microsoft.Extensions.Logging.ILoggingBuilder> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function ConfigureLogging (hostBuilder As IWebHostBuilder, configureLogging As Action(Of WebHostBuilderContext, ILoggingBuilder)) As IWebHostBuilder
參數
- hostBuilder
- IWebHostBuilder
要設定的 IWebHostBuilder。
- configureLogging
- Action<WebHostBuilderContext,ILoggingBuilder>
設定 LoggerFactory 的委派。
傳回
適用於
ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>)
新增用於設定所提供 ILoggingBuilder 的委派。 可能會多次呼叫此項。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ ConfigureLogging(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::Logging::ILoggingBuilder ^> ^ configureLogging);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder ConfigureLogging (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Action<Microsoft.Extensions.Logging.ILoggingBuilder> configureLogging);
static member ConfigureLogging : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Action<Microsoft.Extensions.Logging.ILoggingBuilder> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function ConfigureLogging (hostBuilder As IWebHostBuilder, configureLogging As Action(Of ILoggingBuilder)) As IWebHostBuilder
參數
- hostBuilder
- IWebHostBuilder
要設定的 IWebHostBuilder。
- configureLogging
- Action<ILoggingBuilder>
設定 ILoggingBuilder 的委派。