You may want to log everything to the file but only Warn and up to elmah.io. Consider the scenario where you are logging both to a local file and elmah.io. Log levels are used to mark the severity of each message as well as other features in NLog like log filtering. Understanding log levels and putting the right level on each message is very important. Log levelsĪll log messages have a severity called "Level". If you are already familiar with similar logging frameworks, you will quickly be up and running logging with NLog. NLog provides a great API for logging messages to one or more targets. Also, NLog offers great flexibility when it comes to formatting messages and including additional information on each message. Everything from the console to SQL Server, document databases, and elmah.io is supported and there are almost 100 of them. Much like log4net and Serilog, NLog lets you log messages to a range of data stores (called targets).
In this post, I'll tell you everything there is to know about NLog. NLog has developed impressively over the years and offers all of the modern features available in similar logging frameworks like Serilog and. Then Serilog came out and I lost track of the progress on NLog.
Such a step up from the world of log4net. When NLog originally came out, I was hooked.