Click or drag to resize

LogManager Class

Creates and manages instances of Logger objects.
Inheritance Hierarchy
SystemObject
  NLogLogManager

Namespace:  NLog
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public static class LogManager

The LogManager type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberAutoShutdown
Gets or sets a value indicating whether to automatically call Shutdown on AppDomain.Unload or AppDomain.ProcessExit
Public propertyStatic memberConfiguration
Gets or sets the current logging configuration.
Public propertyStatic memberGlobalThreshold
Gets or sets the global log threshold. Log events below this threshold are not logged.
Public propertyStatic memberKeepVariablesOnReload
Gets or sets a value indicating whether Variables should be kept on configuration reload.
Public propertyStatic memberLogFactory
Gets the LogFactory instance used in the LogManager.
Public propertyStatic memberThrowConfigExceptions
Gets or sets a value indicating whether NLogConfigurationException should be thrown.
Public propertyStatic memberThrowExceptions
Gets or sets a value indicating whether NLog should throw exceptions. By default exceptions are not thrown under any circumstances.
Top
Methods
  NameDescription
Public methodStatic memberAddHiddenAssembly Obsolete.
Adds the given assembly which will be skipped when NLog is trying to find the calling method on stack trace.
Public methodStatic memberCreateNullLogger
Creates a logger that discards all log messages.
Public methodStatic memberFlush
Flush any pending log messages (in case of asynchronous targets) with the default timeout of 15 seconds.
Public methodStatic memberFlush(AsyncContinuation)
Flush any pending log messages (in case of asynchronous targets).
Public methodStatic memberFlush(Int32)
Flush any pending log messages (in case of asynchronous targets).
Public methodStatic memberFlush(TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
Public methodStatic memberFlush(AsyncContinuation, Int32)
Flush any pending log messages (in case of asynchronous targets).
Public methodStatic memberFlush(AsyncContinuation, TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
Public methodStatic memberGetCurrentClassLogger
Gets the logger with the full name of the current class, so namespace and class name.
Public methodStatic memberGetLogger
Gets the specified named logger.
Public methodStatic memberIsLoggingEnabled
Returns if logging is currently enabled.
Public methodStatic memberReconfigExistingLoggers
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 methodStatic memberReconfigExistingLoggers(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 methodStatic memberResumeLogging
Public methodStatic memberSetup
Begins configuration of the LogFactory options using fluent interface
Public methodStatic memberSetup(ActionISetupBuilder)
Begins configuration of the LogFactory options using fluent interface
Public methodStatic memberShutdown
Dispose all targets, and shutdown logging.
Public methodStatic memberSuspendLogging
Suspends the logging, and returns object for using-scope so scope-exit calls ResumeLogging
Top
Events
  NameDescription
Public eventStatic memberConfigurationChanged
Occurs when logging Configuration changes. Both when assigned to new config or config unloaded.
Top
Remarks
LogManager wraps a singleton instance of LogFactory.
See Also