ILoggingBuilder 介面

定義

用於設定記錄提供者的介面。An interface for configuring logging providers.

public interface class ILoggingBuilder
public interface ILoggingBuilder
type ILoggingBuilder = interface
Public Interface ILoggingBuilder

屬性

Services

取得設定記錄服務的 IServiceCollectionGets the IServiceCollection where Logging services are configured.

擴充方法

AddAzureWebAppDiagnostics(ILoggingBuilder)

新增 Azure Web Apps 診斷記錄器。Adds an Azure Web Apps diagnostics logger.

AddConfiguration(ILoggingBuilder)

新增取用 ILoggerProviderConfigurationFactoryILoggerProviderConfiguration<T> 所需要的服務Adds services required to consume ILoggerProviderConfigurationFactory or ILoggerProviderConfiguration<T>

AddConsole(ILoggingBuilder)

將名為 'Console' 的主控台記錄器新增至 Factory。Adds a console logger named 'Console' to the factory.

AddConsole(ILoggingBuilder, Action<ConsoleLoggerOptions>)

將名為 'Console' 的主控台記錄器新增至 Factory。Adds a console logger named 'Console' to the factory.

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

新增自訂主控台記錄格式器。Adds a custom console logger formatter.

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder, Action<TOptions>)

新增使用指定選項進行設定的自訂主控台記錄格式器。Adds a custom console logger formatter to be configured with the specified options.

AddJsonConsole(ILoggingBuilder)

將名為 'json' 的主控台記錄格式器新增到具有預設屬性的處理站。Adds a console log formatter named 'json' to the factory with default properties.

AddJsonConsole(ILoggingBuilder, Action<JsonConsoleFormatterOptions>)

將名為 'json' 的主控台記錄格式器新增到設定了指定 Json 主控台格式器選項的處理站。Adds a console log formatter named 'json' to the factory configured with the specified Json console formatter options.

AddSimpleConsole(ILoggingBuilder)

將名為 'simple' 的預設主控台記錄格式器新增到具有預設屬性的處理站。Adds the default console log formatter named 'simple' to the factory with default properties.

AddSimpleConsole(ILoggingBuilder, Action<SimpleConsoleFormatterOptions>)

將名為 'simple' 的主控台記錄格式器新增到設定了簡易主控台格式器選項設定的處理站。Adds a console log formatter named 'simple' to the factory configured with the specified simple console formatter options.

AddSystemdConsole(ILoggingBuilder)

將名為 'systemd' 的主控台記錄格式器新增到具有預設屬性的處理站。Adds a console log formatter named 'systemd' to the factory with default properties.

AddSystemdConsole(ILoggingBuilder, Action<ConsoleFormatterOptions>)

將名為 'systemd' 的主控台記錄格式器新增到設定了指定主控台格式器選項設定的處理站。Adds a console log formatter named 'systemd' to the factory configured with the specified console formatter options.

AddDebug(ILoggingBuilder)

將名為 'Debug' 的偵錯記錄器新增至 Factory。Adds a debug logger named 'Debug' to the factory.

AddEventLog(ILoggingBuilder)

將名為 'EventLog' 的事件記錄器新增至 Factory。Adds an event logger named 'EventLog' to the factory.

AddEventLog(ILoggingBuilder, EventLogSettings)

新增事件記錄器。Adds an event logger. 使用 settings 來啟用特定 LogLevel 的記錄。Use settings to enable logging for specific LogLevels.

AddEventLog(ILoggingBuilder, Action<EventLogSettings>)

新增事件記錄器。Adds an event logger. 使用 configure 來啟用特定 LogLevel 的記錄。Use configure to enable logging for specific LogLevels.

AddEventSourceLogger(ILoggingBuilder)

將名為 'EventSource' 的事件記錄器新增至 Factory。Adds an event logger named 'EventSource' to the factory.

AddFilter(ILoggingBuilder, Func<LogLevel,Boolean>)

新增記錄篩選至 Factory。Adds a log filter to the factory.

AddFilter(ILoggingBuilder, Func<String,LogLevel,Boolean>)

新增記錄篩選至 Factory。Adds a log filter to the factory.

AddFilter(ILoggingBuilder, Func<String,String,LogLevel,Boolean>)

新增記錄篩選至 Factory。Adds a log filter to the factory.

AddFilter(ILoggingBuilder, String, LogLevel)

新增記錄篩選至 Factory。Adds a log filter to the factory.

AddFilter(ILoggingBuilder, String, Func<LogLevel,Boolean>)

新增記錄篩選至 Factory。Adds a log filter to the factory.

AddFilter<T>(ILoggingBuilder, Func<LogLevel,Boolean>)

為指定的 ILoggerProvider 新增記錄篩選。Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, Func<String,LogLevel,Boolean>)

為指定的 ILoggerProvider 新增記錄篩選。Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, String, LogLevel)

為指定的 ILoggerProvider 新增記錄篩選。Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, String, Func<LogLevel,Boolean>)

為指定的 ILoggerProvider 新增記錄篩選。Adds a log filter for the given ILoggerProvider.

AddConfiguration(ILoggingBuilder, IConfiguration)

IConfiguration的執行個體設定記錄器篩選選項。Configures logger filter options from an instance of IConfiguration.

AddProvider(ILoggingBuilder, ILoggerProvider)

將指定的 ILoggerProvider 新增至 ILoggingBuilder ,以供可鏈結呼叫。Adds the given ILoggerProvider to the ILoggingBuilder so that calls can be chained.

ClearProviders(ILoggingBuilder)

builder 移除所有記錄器提供者。Removes all logger providers from builder.

SetMinimumLevel(ILoggingBuilder, LogLevel)

為要記錄的記錄訊息設定最小 LogLevel 需求。Sets a minimum LogLevel requirement for log messages to be logged.

AddTraceSource(ILoggingBuilder, SourceSwitch)

將名為 'TraceSource' 的 TraceSource 記錄器新增至 Factory。Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggingBuilder, SourceSwitch, TraceListener)

將名為 'TraceSource' 的 TraceSource 記錄器新增至 Factory。Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggingBuilder, String)

將名為 'TraceSource' 的 TraceSource 記錄器新增至 Factory。Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggingBuilder, String, TraceListener)

將名為 'TraceSource' 的 TraceSource 記錄器新增至 Factory。Adds a TraceSource logger named 'TraceSource' to the factory.

適用於