C# 클래스 NLog.LogFactory

Creates and manages instances of T:NLog.Logger objects.
상속: IDisposable
파일 보기 프로젝트 열기: shiftkey/winrt-backport-hilarity 1 사용 예제들

공개 메소드들

메소드 설명
CreateNullLogger ( ) : Logger

Creates a logger that discards all log messages.

DisableLogging ( ) : IDisposable

Decreases the log enable counter and if it reaches -1 the logs are disabled.

Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EnableLogging ( ) : void

Increases the log enable counter and if it reaches 0 the logs are disabled.

Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.

Flush ( ) : void

Flush any pending log messages (in case of asynchronous targets).

Flush ( AsyncContinuation asyncContinuation ) : void

Flush any pending log messages (in case of asynchronous targets).

Flush ( AsyncContinuation asyncContinuation, System.TimeSpan timeout ) : void

Flush any pending log messages (in case of asynchronous targets).

Flush ( AsyncContinuation asyncContinuation, int timeoutMilliseconds ) : void

Flush any pending log messages (in case of asynchronous targets).

Flush ( System.TimeSpan timeout ) : void

Flush any pending log messages (in case of asynchronous targets).

Flush ( int timeoutMilliseconds ) : void

Flush any pending log messages (in case of asynchronous targets).

GetLogger ( string name ) : Logger

Gets the specified named logger.

GetLogger ( string name, Type loggerType ) : Logger

Gets the specified named logger.

IsLoggingEnabled ( ) : bool

Returns if logging is currently enabled.

Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.

LogFactory ( ) : System

Initializes a new instance of the LogFactory class.

LogFactory ( LoggingConfiguration config ) : System

Initializes a new instance of the LogFactory class.

ReconfigExistingLoggers ( ) : void

Loops through all loggers previously returned by GetLogger and recalculates their target and filter list. Useful after modifying the configuration programmatically to ensure that all loggers have been properly configured.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

비공개 메소드들

메소드 설명
ConfigFileChanged ( object sender, EventArgs args ) : void
Dump ( LoggingConfiguration config ) : void
GetCandidateFileNames ( ) : IEnumerable
GetConfigurationForLogger ( string name, LoggingConfiguration configuration ) : LoggerConfiguration
GetCurrentClassLogger ( ) : Logger
GetCurrentClassLogger ( Type loggerType ) : Logger
GetLogger ( LoggerCacheKey cacheKey ) : Logger
GetTargetsByLevelForLogger ( string name, IList rules, NLog.Internal.TargetWithFilterChain targetsByLevel, NLog.Internal.TargetWithFilterChain lastTargetsByLevel ) : void
ReconfigExistingLoggers ( LoggingConfiguration configuration ) : void
ReloadConfigOnTimer ( object state ) : void

메소드 상세

CreateNullLogger() 공개 메소드

Creates a logger that discards all log messages.
public CreateNullLogger ( ) : Logger
리턴 Logger

DisableLogging() 공개 메소드

Decreases the log enable counter and if it reaches -1 the logs are disabled.
Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.
public DisableLogging ( ) : IDisposable
리턴 IDisposable

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool True to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

EnableLogging() 공개 메소드

Increases the log enable counter and if it reaches 0 the logs are disabled.
Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.
public EnableLogging ( ) : void
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( ) : void
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( AsyncContinuation asyncContinuation ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( AsyncContinuation asyncContinuation, System.TimeSpan timeout ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
timeout System.TimeSpan Maximum time to allow for the flush. Any messages after that time will be discarded.
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( AsyncContinuation asyncContinuation, int timeoutMilliseconds ) : void
asyncContinuation AsyncContinuation The asynchronous continuation.
timeoutMilliseconds int Maximum time to allow for the flush. Any messages after that time will be discarded.
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( System.TimeSpan timeout ) : void
timeout System.TimeSpan Maximum time to allow for the flush. Any messages after that time will be discarded.
리턴 void

Flush() 공개 메소드

Flush any pending log messages (in case of asynchronous targets).
public Flush ( int timeoutMilliseconds ) : void
timeoutMilliseconds int Maximum time to allow for the flush. Any messages after that time will be discarded.
리턴 void

GetLogger() 공개 메소드

Gets the specified named logger.
public GetLogger ( string name ) : Logger
name string Name of the logger.
리턴 Logger

GetLogger() 공개 메소드

Gets the specified named logger.
public GetLogger ( string name, Type loggerType ) : Logger
name string Name of the logger.
loggerType System.Type The type of the logger to create. The type must inherit from NLog.Logger.
리턴 Logger

IsLoggingEnabled() 공개 메소드

Returns if logging is currently enabled.
Logging is enabled if the number of EnableLogging calls is greater than or equal to DisableLogging calls.
public IsLoggingEnabled ( ) : bool
리턴 bool

LogFactory() 공개 메소드

Initializes a new instance of the LogFactory class.
public LogFactory ( ) : System
리턴 System

LogFactory() 공개 메소드

Initializes a new instance of the LogFactory class.
public LogFactory ( LoggingConfiguration config ) : System
config NLog.Config.LoggingConfiguration The config.
리턴 System

ReconfigExistingLoggers() 공개 메소드

Loops through all loggers previously returned by GetLogger and recalculates their target and filter list. Useful after modifying the configuration programmatically to ensure that all loggers have been properly configured.
public ReconfigExistingLoggers ( ) : void
리턴 void