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 -
  • Log4Net -
  • NLog -
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: but still it was not a conclusive choice.

Currently I am leaning at NLog. Any Opinions ?

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: