Monday, May 7, 2012

C# logging framework

My team is starting a new big project at work and naturally we start off by choosing our infrastructure. The first task is choosing a Logging solution.
Since most of the project is in C#, I trimmed it down to 3 options:
  • Microsoft Enterprise Libraries - http://msdn.microsoft.com/en-us/library/ff648951.aspx
  • Log4Net - http://logging.apache.org/log4net/
  • NLog - http://nlog-project.org/
All 3 are valid options however I found that EntLib is over bloated with unneeded code and usually requires a wrapper to keep the usage simple.

As for Log4Net and NLog, both have a similar interface that is easy to learn and are highly configurable.
Checking user opinions on the web I could not see a clear consensus as of which is the better framework.

I did find a nice comparison of the frameworks at: http://essentialdiagnostics.codeplex.com/wikipage?title=Comparison&referringTitle=Guidance but still it was not a conclusive choice.

Currently I am leaning at NLog. Any Opinions ?

Update:
We have chosen Nlog as our framework since there are a lot of old bugs and change requests for log4net that aren't being addressed. It seems like development and maintenance slowed down terribly. It also looks like the industry is heading in this direction anyway.

I'll keep you updated on how it goes.






1 comment: