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: 4.4
Syntax
public sealed class LogManager

The LogManager type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberConfiguration
Gets or sets the current logging configuration. Configuration
Public propertyStatic memberDefaultCultureInfo Obsolete.
Gets or sets the default culture to use.
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. Default value - false.
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
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 memberDisableLogging
Decreases the log enable counter and if it reaches -1 the logs are disabled.
Public methodStatic memberEnableLogging
Increases the log enable counter and if it reaches 0 the logs are disabled.
Public methodStatic memberFlush
Flush any pending log messages (in case of asynchronous targets) with the default timeout of 15 seconds.
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)
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 name of the current class.
Public methodStatic memberGetCurrentClassLogger(Type)
Gets a custom logger with the name of the current class. Use loggerType to pass the type of the needed Logger.
Public methodStatic memberGetLogger(String)
Gets the specified named logger.
Public methodStatic memberGetLogger(String, Type)
Gets the specified named custom logger. Use loggerType to pass the type of the needed Logger.
Public methodStatic memberIsLoggingEnabled
Checks 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 memberShutdown
Dispose all targets, and shutdown logging.
Top
Events
  NameDescription
Public eventStatic memberConfigurationChanged
Occurs when logging Configuration changes.
Public eventStatic memberConfigurationReloaded
Occurs when logging Configuration gets reloaded.
Top
See Also