NullLoggerFactory 類別

定義

用來建立 NullLogger 實執行個體 (其不會記錄任何內容) 的 ILoggerFactoryAn ILoggerFactory used to create instance of NullLogger that logs nothing.

public ref class NullLoggerFactory : IDisposable, Microsoft::Extensions::Logging::ILoggerFactory
public class NullLoggerFactory : IDisposable, Microsoft.Extensions.Logging.ILoggerFactory
type NullLoggerFactory = class
    interface ILoggerFactory
    interface IDisposable
Public Class NullLoggerFactory
Implements IDisposable, ILoggerFactory
繼承
NullLoggerFactory
實作

建構函式

NullLoggerFactory()

建立新的 NullLoggerFactory 執行個體。Creates a new NullLoggerFactory instance.

欄位

Instance

傳回 NullLoggerFactory 的共用執行個體。Returns the shared instance of NullLoggerFactory.

方法

AddProvider(ILoggerProvider)
CreateLogger(String)
Dispose()
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

擴充方法

AddAzureWebAppDiagnostics(ILoggerFactory)

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

AddAzureWebAppDiagnostics(ILoggerFactory, AzureAppServicesDiagnosticsSettings)

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

AddConsole(ILoggerFactory)

新增針對資訊或更高層級 LogLevel 啟用的主控台記錄器。Adds a console logger that is enabled for LogLevel.Information or higher.

AddConsole(ILoggerFactory, IConfiguration)
AddConsole(ILoggerFactory, IConsoleLoggerSettings)
AddConsole(ILoggerFactory, LogLevel)

新增針對 minLevel 或更高層級 LogLevel 啟用的主控台記錄器。Adds a console logger that is enabled for LogLevels of minLevel or higher.

AddConsole(ILoggerFactory, LogLevel, Boolean)

新增針對 minLevel 或更高層級 LogLevel 啟用的主控台記錄器。Adds a console logger that is enabled for LogLevels of minLevel or higher.

AddConsole(ILoggerFactory, Boolean)

新增針對資訊或更高層級 LogLevel 啟用的主控台記錄器。Adds a console logger that is enabled for LogLevel.Information or higher.

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>)

新增依篩選函式定義而啟用的主控台記錄器。Adds a console logger that is enabled as defined by the filter function.

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>, Boolean)

新增依篩選函式定義而啟用的主控台記錄器。Adds a console logger that is enabled as defined by the filter function.

AddDebug(ILoggerFactory)

新增針對資訊或更高層級 LogLevel 啟用的偵錯記錄器。Adds a debug logger that is enabled for LogLevel.Information or higher.

AddDebug(ILoggerFactory, LogLevel)

新增針對 minLevel 或更高層級 LogLevel 啟用的偵錯記錄器。Adds a debug logger that is enabled for LogLevels of minLevel or higher.

AddDebug(ILoggerFactory, Func<String,LogLevel,Boolean>)

新增依篩選函式定義而啟用的偵錯記錄器。Adds a debug logger that is enabled as defined by the filter function.

AddEventLog(ILoggerFactory)

新增針對資訊或更高層級 LogLevel 啟用的事件記錄器。Adds an event logger that is enabled for LogLevel.Information or higher.

AddEventLog(ILoggerFactory, EventLogSettings)

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

AddEventLog(ILoggerFactory, LogLevel)

新增針對 minLevel 或更高層級 LogLevel 啟用的事件記錄器。Adds an event logger that is enabled for LogLevels of minLevel or higher.

AddEventSourceLogger(ILoggerFactory)

新增針對資訊或更高層級 LogLevel 啟用的事件記錄器。Adds an event logger that is enabled for LogLevel.Information or higher.

CreateLogger(ILoggerFactory, Type)

使用指定 type 的完整名稱,建立新的 ILogger 執行個體。Creates a new ILogger instance using the full name of the given type.

CreateLogger<T>(ILoggerFactory)

使用指定類型的完整名稱,建立新的 ILogger 執行個體。Creates a new ILogger instance using the full name of the given type.

AddTraceSource(ILoggerFactory, SourceSwitch)
AddTraceSource(ILoggerFactory, SourceSwitch, TraceListener)
AddTraceSource(ILoggerFactory, String)
AddTraceSource(ILoggerFactory, String, TraceListener)

適用於