When comparing NLog vs log4net, the Slant community recommends NLog for most people. In the question“What are the best .NET logging frameworks?” NLog is ranked 1st while log4net is ranked 3rd. The most important reason people chose NLog is:
The config file is fairly easy to understand and modify without having to pore over pages and pages of documentation.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easily configurable
The config file is fairly easy to understand and modify without having to pore over pages and pages of documentation.
Pro Supports Semantic Logging
Pro Easy to set up
Getting starting with NLog is quick and you can be up and running in a matter of minutes by following the official Getting Started tutorial.
Pro Widely Used
Using log4net is a safe bet - many other open-source projects use it as well and it'll be just another dependency you don't have to worry about. This also means finding support to fix bugs is a lot easier!
Pro Robust
Has all the features you'll most likely need, and is quite configurable. Basically what you'd expect from a very popular and widely-used framework.
Pro Supports Multiple Frameworks
Pro Modular and Extendable
Has plugins for most of the things you'll need to get done without having to deal with too much unnecessary functionality.
Cons
Con Dealing with errors can be a pain
Because of the poor documentation and difficulty of configuration you might end up spending a lot of time just trying to fix things that aren't working.
Con Confusing Documentation
Documentation is quite difficult to navigate through unless you know exactly what you're looking for.