Skip to content

Platform specific: NLog

Ioan Crisan edited this page Dec 8, 2016 · 3 revisions

NLog implementation of the logging infrastructure

The implementation complexity is hidden under the Tnsa.Foundation.Logging.NLog namespace.

The NLogManager

This builder class is used to adapt the NLog manager and expose the implemented ILogManager interface to the ambient services.

  • Service contract: ILogManager
  • Instancing: singleton
  • Mode: single

Remarks: this class is normally not used as such, but through the AmbientServicesBuilder's extension methods (see below).

The NLogAmbientServicesBuilderExtensions

This static class provides convenience methods for initializing the logging infrastructure in the ambient services.

Example

    var ambientServicesBuilder = new AmbientServicesBuilder().WithNLogManager();
    var myClassLogger = ambientServicesBuilder.AmbientServices.LogManager.GetLogger<MyClass>();

Clone this wiki locally