Click or drag to resize
NLogLogFactory Class
Creates and manages instances of Logger objects.
Inheritance Hierarchy

Namespace: NLog
Assembly: NLog (in NLog.dll) Version: 0.0.0.0
Syntax
public class LogFactory : IDisposable

The LogFactory type exposes the following members.

Constructors
  NameDescription
Public methodLogFactory
Initializes a new instance of the LogFactory class.
Public methodLogFactory(LoggingConfiguration)
Initializes a new instance of the LogFactory class.
Top
Methods
  NameDescription
Public methodCreateNullLogger
Creates a logger that discards all log messages.
Public methodDisableLogging Obsolete.
Decreases the log enable counter and if it reaches -1 the logs are disabled.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Public methodEnableLogging Obsolete.
Increases the log enable counter and if it reaches 0 the logs are disabled.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlush
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)
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 named after the currently-being-initialized class.
Public methodGetCurrentClassLogger(Type)
Gets the logger named after the currently-being-initialized class.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLogger(String)
Gets the specified named logger.
Public methodGetLogger(String, Type)
Gets the specified named logger.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsLoggingEnabled
Returns if logging is currently enabled.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnConfigurationChanged
Invoke the Changed event; called whenever list changes
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 methodResumeLogging
Increases the log enable counter and if it reaches 0 the logs are disabled.
Public methodSuspendLogging
Decreases the log enable counter and if it reaches -1 the logs are disabled.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyConfiguration
Gets or sets the current logging configuration.
Public propertyStatic memberCurrentAppDomain
Gets the current IAppDomain.
Public propertyDefaultCultureInfo
Gets the default culture info to use as FormatProvider.
Public propertyGlobalThreshold
Gets or sets the global log threshold. Log events below this threshold are not logged.
Public propertyThrowExceptions
Gets or sets a value indicating whether exceptions should be thrown.
Top
Events
  NameDescription
Public eventConfigurationChanged
Occurs when logging Configuration changes.
Public eventConfigurationReloaded
Occurs when logging Configuration gets reloaded.
Top
See Also