Search Results for

    Show / Hide Table of Contents

    Class NLogDisposableFactory

    An actionETL logging factory implementation, using NLog for the logging. Use this class to create your own log factory instance, which can be injected into worker systems, and/or used outside worker systems.

    This class is the same as NLogFactory, except that it handles the scenarios where the logging factory must be disposed after use.

    Inheritance
    Object
    NLogFactory
    NLogDisposableFactory
    Implements
    IALogFactory
    IDisposable
    Inherited Members
    NLogFactory.Configuration
    NLogFactory.CreateDefaultConfiguration()
    NLogFactory.Flush(Int32)
    NLogFactory.Flush()
    NLogFactory.GetLogger(String)
    NLogFactory.GetLogger(Type)
    NLogFactory.GetSingleton(Boolean)
    NLogFactory.GetSingleton()
    NLogFactory.ReconfigExistingLoggers()
    Namespace: actionETL.Logging.NLogExternal
    Assembly: actionETL.dll
    Syntax
    public sealed class NLogDisposableFactory : NLogFactory, IALogFactory, IDisposable

    Methods

    Create()

    Creates a (non-singleton) NLog logging factory, which is not automatically shared with other logging factories, and must be disposed after use.

    This method is thread-safe.

    If no configuration file is found in the standard locations, a default configuration is created and used (see CreateDefaultConfiguration()).

    Declaration
    public static NLogDisposableFactory Create()
    Returns
    Type Description
    NLogDisposableFactory

    A (non-singleton) disposable logging factory.

    Exceptions
    Type Condition
    InvalidOperationException

    No NLog logging configuration file found.

    Create(LoggingConfiguration)

    Creates a (non-singleton) NLog logging factory (using the provided LoggingConfiguration), which is not automatically shared with other logging factories, and must be disposed after use.

    This method is thread-safe.

    Declaration
    public static NLogDisposableFactory Create(LoggingConfiguration loggingConfiguration)
    Parameters
    Type Name Description
    NLog.Config.LoggingConfiguration loggingConfiguration

    The NLog logging configuration. Provided via an XmlLoggingConfiguration or LoggingConfiguration instance.

    Returns
    Type Description
    NLogDisposableFactory

    A (non-singleton) disposable logging factory.

    Exceptions
    Type Condition
    ArgumentNullException

    loggingConfiguration

    Create(Boolean)

    Creates a (non-singleton) NLog logging factory, which is not automatically shared with other logging factories, and must be disposed after use.

    This method is thread-safe.

    Declaration
    public static NLogDisposableFactory Create(bool requireConfigurationFile)
    Parameters
    Type Name Description
    Boolean requireConfigurationFile

    If set to true, and no configuration file is found in the standard locations, throw an exception. If set to false, and no configuration file is found in the standard locations, a default configuration is created and used (see CreateDefaultConfiguration()).

    Returns
    Type Description
    NLogDisposableFactory

    A (non-singleton) disposable logging factory.

    Exceptions
    Type Condition
    InvalidOperationException

    No NLog logging configuration file found.

    Dispose()

    Disposes the logging factory.

    Declaration
    public void Dispose()

    Implements

    IALogFactory
    System.IDisposable

    See Also

    NLogDisposableFactory
    IALogFactory
    In This Article
    Back to top Copyright © 2023 Envobi Ltd