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.
Implements
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
| Exception | exception | The exception, can be |
| String | message | The message, can be |
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 |
| ALogLevel | logLevel | The log level. |
| String | category | The category, can be |
| Exception | exception | The exception, can be |