简体   繁体   English

采用洋葱架构的Aslog.Net核心NLog

[英]NLog in Asp.Net Core with Onion Architecture

In a Onion Architecture context, how would I implement NLog in Asp.Net Core? 在洋葱架构环境中,如何在Asp.Net Core中实现NLog? 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? 我想我必须创建一个单独的项目,其范围是将NLog包装并映射到本机.dotnet Core Logger(Microsoft.Extensions.Logging.ILogger),然后将此依赖项添加到Web项目以及其他项目(服务)中,其他基础设施......),对吗?

Thank you so much. 非常感谢。

This is my solution 这是我的解决方案

The asp.net core project has no references to NLog. asp.net核心项目没有引用NLog。

Project NLogNet in the repo implements the standard solution repo中的NLogNet项目实现了标准解决方案

All other projects implements the solution with a structure based on Onion Architecture 所有其他项目都使用基于Onion Architecture的结构实现解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM