Question

I am trying to evaluate some of the best log utilities available for .NET framework, such as Microsoft Enterprise Library, Log4Net, elmah.

Can someone who has already gone through this exercise would come to my help in listing pros and cons of the best available in the market.

Thanks & Regards, Rajeev Ranjan Lall

Was it helpful?

Solution

In general good one is Log4net.

PROS: Log4Net supports many output sources.
CONS: Sometimes can slow your application.

For ASP.NET application is of the best ELMAH.

PROS: You do not have to change an application code a bit to use Elmah. You have to just include in you application.
CONS: Not that I know.

OTHER TIPS

I have also heard good things about NLog although I haven't tested yet. They say the API is similar to the one provided by log4net.

Also, looking through SO you have a lot of questions related with this issue:

https://stackoverflow.com/questions/98080/what-is-the-best-logging-solution-for-a-c-net-3-5-project

.NET logging framework

Error logging in C#

Hope this helps.

Take a look at my logging framework. Easy to use. Easy to configure. Easy to extend.

And listen to what this guy says.

log4net for Windows Forms, log4net and ELMAH for ASP.NET.

ELMAH and log4net have different purposes. ELMAH captures data regarding unhandled exceptions whereas log4net provides a logging framework at configurable levels (INFO, WARN, DEBUG, FATAL). log4net requires that you actively write logging statements in your code; ELMAH works automatically once properly configured.

elmah is the best. elmah rocks!

Enterprise Library is the only formal edition I have experience with, and our team found it too cumbersome and lacking in versatility for prime-time. You can safely avoid it and would likely end up better off coding your own solution instead.

I haven't had the opportunity to use either Log4Net or Elmah.

I used to use my own custom, entlib, log4net and then Elmah

For asp.net error reporting Elmah is head and shoulders above the rest. However a couple of things I would like to see improved is the filtering and maybe a daily digest of email rather than one email per error.

If you want to inject logging, warns, debugs, traces etc then I would opt for log4net.

However it depends on the type of logging you are after...

Check out Gibraltar for great logging plus a lot more.

It has it's own logging API and we also have adapters for log4net, NLog, and the Object Guy's logging framework (PostSharp too!). Besides logging, Gibraltar also collects errors like ELMAH as well as collecting additional metrics useful for customer support or CEIP.

Haven't seen this mentioned yet, but I've found that the built-in System.Diagnostics TraceSource and TraceListeners are very powerful for logging. We've built a number of high-performance custom TraceListeners for different data sources we persist logs to.

We swap in and out different listeners in the config file all the time. We take advantage of System.Diagnostics.CorrelationManager to walk chain of execution through many servers, processes and threads via logs.

All in all we have a sophisticated logging solution built on top of what came with the framework, and I'm very happy with it.

I've used Logstash (https://www.elastic.co/products/logstash) & this is pretty good & open source.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top