Logging backend for NLog.
Implements
Namespace: PostSharp.Patterns.Diagnostics.Backends.NLog
Assembly: PostSharp.Patterns.Diagnostics.Backends.NLog.dll
Syntax
public class NLogLoggingBackend : TextLoggingBackend, IDisposableRemarks
To use this backend, assign a new instance to DefaultBackend when the application starts. Pass a LogFactory to the constructor to choose the NLog configuration that receives the records; otherwise, the backend uses the global NLog.LogManager.
When NLogCollectingTarget routes the events that your code logs directly with NLog through PostSharp Logging, create this backend with a separate LogFactory whose configuration contains the output targets, not the global configuration that contains the collecting target.
Constructors
| Name | Description |
|---|---|
| NLogLoggingBackend() | Initializes a new instance of the NLogLoggingBackend class. |
| NLogLoggingBackend(LogFactory) | Initializes a new instance of the NLogLoggingBackend class and specifies the target LogFactory. |
Properties
| Name | Description |
|---|---|
| LogFactory | Gets the LogFactory passed to the constructor of the current NLogLoggingBackend, or |
| Options | Gets the backend options. |
Methods
| Name | Description |
|---|---|
| CreateRecordBuilder() | Creates a new LogRecordBuilder. |
| CreateTypeSource(LoggingNamespaceSource, Type) | Creates a LoggingTypeSource for the given role and type. |
| CreateTypeSourceBySourceName(LoggingNamespaceSource, string) | Creates a LoggingTypeSource for the given role and logger name. |
| GetTextBackendOptions() | Gets the options. |