Click or drag to resize

LogFactory Methods

The LogFactory type exposes the following members.

Methods
  NameDescription
Public methodCreateNullLogger
Creates a logger that discards all log messages.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Public methodFlush
Flush any pending log messages (in case of asynchronous targets) with the default timeout of 15 seconds.
Public methodFlush(AsyncContinuation)
Flush any pending log messages (in case of asynchronous targets).
Public methodFlush(Int32)
Flush any pending log messages (in case of asynchronous targets).
Public methodFlush(TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
Public methodFlush(AsyncContinuation, Int32)
Flush any pending log messages (in case of asynchronous targets).
Public methodFlush(AsyncContinuation, TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
Public methodGetCurrentClassLogger
Gets the logger with the full name of the current class, so namespace and class name.
Public methodGetCurrentClassLoggerT
Gets the logger with the full name of the current class, so namespace and class name. Use T to create instance of a custom Logger. If you haven't defined your own Logger class, then use the overload without the type parameter.
Public methodGetLogger(String)
Gets the specified named logger.
Public methodGetLoggerT(String)
Gets the specified named logger. Use T to create instance of a custom Logger. If you haven't defined your own Logger class, then use the overload without the type parameter.
Public methodIsLoggingEnabled
Returns if logging is currently enabled.
Protected methodOnConfigurationChanged
Raises the event when the configuration is reloaded.
Protected methodOnConfigurationReloaded Obsolete.
Obsolete and replaced by OnConfigurationReloaded(LoggingConfigurationReloadedEventArgs) with NLog 5.2. Raises the event when the configuration is reloaded.
Public methodReconfigExistingLoggers
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 methodReconfigExistingLoggers(Boolean)
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 methodResumeLogging
Public methodSetup
Begins configuration of the LogFactory options using fluent interface
Public methodSetup(ActionISetupBuilder)
Begins configuration of the LogFactory options using fluent interface
Public methodShutdown
Dispose all targets, and shutdown logging.
Public methodSuspendLogging
Suspends the logging, and returns object for using-scope so scope-exit calls ResumeLogging
Top
See Also