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: 5.3.1+cf6675da40ccfd4c8c526a3b2bdbeed3442910a1
Syntax
public class LogFactory<T> : LogFactory
where T : new(), 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 propertyAutoShutdown
Gets or sets a value indicating whether to automatically call Shutdown on AppDomain.Unload or AppDomain.ProcessExit
(Inherited from LogFactory.)
Public propertyConfiguration
Gets or sets the current logging configuration.
(Inherited from LogFactory.)
Public propertyDefaultCultureInfo
Gets or sets the default culture info to use as FormatProvider.
(Inherited from LogFactory.)
Public propertyGlobalThreshold
Gets or sets the global log level threshold. Log events below this threshold are not logged.
(Inherited from LogFactory.)
Public propertyKeepVariablesOnReload
Gets or sets a value indicating whether Variables should be kept on configuration reload.
(Inherited from LogFactory.)
Public propertyServiceRepository
Repository of interfaces used by NLog to allow override for dependency injection
(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 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 methodFlush
Flush any pending log messages (in case of asynchronous targets) with the default timeout of 15 seconds.
(Inherited from LogFactory.)
Public methodFlush(AsyncContinuation)
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, 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 full name of the current class (so namespace and class name) and type T.
Public methodGetLogger
Gets the logger with type T.
Public methodIsLoggingEnabled
Returns if logging is currently enabled.
(Inherited from LogFactory.)
Protected methodOnConfigurationChanged
Raises the event when the configuration is reloaded.
(Inherited from LogFactory.)
Protected methodOnConfigurationReloaded Obsolete.
Obsolete and replaced by OnConfigurationReloaded(LoggingConfigurationReloadedEventArgs) with NLog 5.2. Raises the event when the configuration is reloaded.
(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 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.
(Inherited from LogFactory.)
Public methodResumeLogging (Inherited from LogFactory.)
Public methodSetup
Begins configuration of the LogFactory options using fluent interface
(Inherited from LogFactory.)
Public methodSetup(ActionISetupBuilder)
Begins configuration of the LogFactory options using fluent interface
(Inherited from LogFactory.)
Public methodShutdown
Dispose all targets, and shutdown logging.
(Inherited from LogFactory.)
Public methodSuspendLogging
Suspends the logging, and returns object for using-scope so scope-exit calls ResumeLogging
(Inherited from LogFactory.)
Top
Events
  NameDescription
Public eventConfigurationChanged
Occurs when logging Configuration changes. Both when assigned to new config or config unloaded.
(Inherited from LogFactory.)
Top
Remarks
Use this only when a custom Logger type is defined.
See Also