Search Results for

    Show / Hide Table of Contents

    Class NLogLogService

    Wraps an NLog logger, and is used by NLogFactory.

    Not used directly by the library user.

    See NLog Logger for more details on the underlying logger.

    Inheritance
    Object
    NLogLogService
    Implements
    IALogService
    Namespace: actionETL.Logging.NLogExternal
    Assembly: actionETL.dll
    Syntax
    public class NLogLogService : IALogService

    Constructors

    NLogLogService(Logger)

    Initializes a new instance of the NLogLogService class.

    Not used directly by the library user.

    Declaration
    public NLogLogService(Logger nLogLogger)
    Parameters
    Type Name Description
    NLog.Logger nLogLogger

    The NLog logger this instance will wrap.

    Exceptions
    Type Condition
    InvalidOperationException

    nLogLogger

    Properties

    IsDebugEnabled

    Gets a value indicating whether logging is enabled for the Debug level.

    This property is thread-safe.

    Declaration
    public bool IsDebugEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Debug level, otherwise false.

    IsErrorEnabled

    Gets a value indicating whether logging is enabled for the Error level.

    This property is thread-safe.

    Declaration
    public bool IsErrorEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Error level, otherwise false.

    IsFatalEnabled

    Gets a value indicating whether logging is enabled for the Fatal level.

    This property is thread-safe.

    Declaration
    public bool IsFatalEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Fatal level, otherwise false.

    IsInfoEnabled

    Gets a value indicating whether logging is enabled for the Info level.

    This property is thread-safe.

    Declaration
    public bool IsInfoEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Info level, otherwise false.

    IsTraceEnabled

    Gets a value indicating whether logging is enabled for the Trace level.

    This property is thread-safe.

    Declaration
    public bool IsTraceEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Trace level, otherwise false.

    IsWarnEnabled

    Gets a value indicating whether logging is enabled for the Warn level.

    This property is thread-safe.

    Declaration
    public bool IsWarnEnabled { get; }
    Property Value
    Type Description
    Boolean

    true if logging is enabled for the Warn level, otherwise false.

    Name

    Gets the name of the logger.

    This property is thread-safe.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    Methods

    IsEnabled(ALogLevel)

    Gets a value indicating whether logging is enabled for the specified level.

    This method is thread-safe.

    Declaration
    public bool IsEnabled(ALogLevel logLevel)
    Parameters
    Type Name Description
    ALogLevel logLevel

    The log level to check.

    Returns
    Type Description
    Boolean

    true if the specified log level is enabled; otherwise false.

    Log(ALogLevel, String, Exception, String)

    Logs a log event, with a message string.

    This method is thread-safe.

    Declaration
    public void Log(ALogLevel logLevel, string category, Exception exception, string message)
    Parameters
    Type Name Description
    ALogLevel logLevel

    The log level.

    String category

    The category, can be null (although it is advisable to populate this parameter with a non-empty value).

    Exception exception

    The exception, can be null.

    String message

    The message, can be null.

    Log(ALogMessageCallback, ALogLevel, String, Exception)

    Logs a log event, with a message callback.

    This method is thread-safe.

    Declaration
    public void Log(ALogMessageCallback messageFunc, ALogLevel logLevel, string category, Exception exception)
    Parameters
    Type Name Description
    ALogMessageCallback messageFunc

    The message function returning a string. It can be null, as can the returned string, in which case no custom message will be added to the logged event.

    ALogLevel logLevel

    The log level.

    String category

    The category, can be null (although it is advisable to populate this parameter with a non-empty value).

    Exception exception

    The exception, can be null.

    Implements

    IALogService

    See Also

    IALogService
    In This Article
    Back to top Copyright © 2023 Envobi Ltd