Click or drag to resize
LogFactoryT Class
Specialized LogFactory that can return instances of custom logger types.
Inheritance Hierarchy
SystemObject
  NLogLogFactory
    NLogLogFactoryT

Namespace: NLog
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public class LogFactory<T> : LogFactory
where T : Logger

Type Parameters

T
The type of the logger to be returned. Must inherit from Logger.

The LogFactoryT type exposes the following members.

Constructors
  NameDescription
Public methodLogFactoryT
Initializes a new instance of the LogFactoryT class
Top
Properties
  NameDescription
Public propertyConfiguration
Gets or sets the current logging configuration. After setting this property all existing loggers will be re-configured, so that there is no need to call ReconfigExistingLoggers manually.
(Inherited from LogFactory.)
Public propertyDefaultCultureInfo
Gets the default culture info to use as FormatProvider.
(Inherited from LogFactory.)
Public propertyGlobalThreshold
Gets or sets the global log threshold. Log events below this threshold are not logged.
(Inherited from LogFactory.)
Public propertyThrowConfigExceptions
Gets or sets a value indicating whether NLogConfigurationException should be thrown. If null then ThrowExceptions is used.
(Inherited from LogFactory.)
Public propertyThrowExceptions
Gets or sets a value indicating whether exceptions should be thrown. See also ThrowConfigExceptions.
(Inherited from LogFactory.)
Top
Methods
  NameDescription
Public methodCreateNullLogger
Creates a logger that discards all log messages.
(Inherited from LogFactory.)
Public methodDisableLogging Obsolete.
Decreases the log enable counter and if it reaches -1 the logs are disabled.
(Inherited from LogFactory.)
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from LogFactory.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Inherited from LogFactory.)
Public methodEnableLogging Obsolete.
Increases the log enable counter and if it reaches 0 the logs are disabled.
(Inherited from LogFactory.)
Public methodFlush
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodFlush(Int32)
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodFlush(TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodFlush(AsyncContinuation)
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodFlush(AsyncContinuation, Int32)
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodFlush(AsyncContinuation, TimeSpan)
Flush any pending log messages (in case of asynchronous targets).
(Inherited from LogFactory.)
Public methodGetCurrentClassLogger
Gets a custom logger with the name of the current class and type T.
Public methodGetCurrentClassLogger(Type)
Gets a custom logger with the name of the current class. Use loggerType to pass the type of the needed Logger.
(Inherited from LogFactory.)
Public methodGetLogger(String)
Gets the logger with type T.
Public methodGetLogger(String, Type)
Gets the specified named logger. Use loggerType to pass the type of the needed Logger.
(Inherited from LogFactory.)
Public methodIsLoggingEnabled
Returns if logging is currently enabled.
(Inherited from LogFactory.)
Protected methodOnConfigurationChanged
Invoke the Changed event; called whenever list changes
(Inherited from LogFactory.)
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.
(Inherited from LogFactory.)
Public methodResumeLogging
Increases the log enable counter and if it reaches 0 the logs are disabled.
(Inherited from LogFactory.)
Public methodSuspendLogging
Decreases the log enable counter and if it reaches -1 the logs are disabled.
(Inherited from LogFactory.)
Top
Events
  NameDescription
Public eventConfigurationChanged
Occurs when logging Configuration changes.
(Inherited from LogFactory.)
Public eventConfigurationReloaded
Occurs when logging Configuration gets reloaded.
(Inherited from LogFactory.)
Top
See Also