How to use NLog from multiple projects in the same solution

只愿长相守 提交于 2019-12-01 14:51:08

问题


I searched the net for a really simple question. My solution is one exe (WPF) project and four class libraries. I need a logging and I like NLog. How can I use it from all of the 5 projects in one solution ?

I don't know, do I need to create (or get somewhere) a wrapper class project referenced from all of the projects and use Nlog from there ? I saw something like this written for log4Net.

Or is there some pattern or best practice for this scenario ?


回答1:


Just reference NLOG directly in each of the projects and use it. But you only need to configure it in your main application. The configuration will then be shared automatically.



来源:https://stackoverflow.com/questions/29188721/how-to-use-nlog-from-multiple-projects-in-the-same-solution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!