Search code examples
c#asp.net-core.net-corenlogonion-architecture

NLog in Asp.Net Core with Onion Architecture


In a Onion Architecture context, how would I implement NLog in Asp.Net Core? I suppose I'll have to create a separate project with the scope to wrapping and mapping NLog to native .dotnet Core Logger (Microsoft.Extensions.Logging.ILogger) and then add this dependency to web project and in case in other project (services, other infrastructures...), right?

Thank you so much.


Solution

  • This is my solution

    The asp.net core project has no references to NLog.

    Project NLogNet in the repo implements the standard solution

    All other projects implements the solution with a structure based on Onion Architecture