log4net versus TraceSource
Posted
by Paul Stovell
on Stack Overflow
See other posts from Stack Overflow
or by Paul Stovell
Published on 2009-02-23T03:37:24Z
Indexed on
2010/04/28
9:13 UTC
Read the original article
Hit count: 504
In this thread many people have indicated that they use log4net. I am a fan of TraceSources and would like to know why log4net is used.
Here is why I like trace sources:
- Pluggable listeners - XML, TextFile, Console, EventLog, roll your own
- Customisable trace switches (error, warning, info, verbose, start, end, custom)
- Customisable configuration
- The Logging Application Block is just a big set of TraceListeners
- Correlation of activities/scopes (e.g., associate all logs within an ASP.NET request with a given customer
- The Service Trace Viewer allows you to visualize events against these activities individually
- All of it is configurable in app.config/web.config.
Since the .NET framework internally uses TraceSources, it also gives me a consistent way of configuring tracing - with log4net, I have to configure log4net as well as TraceSources.
What does log4net give me that TraceSources don't (or that couldn't be done by writing a couple of custom TraceListeners)?
© Stack Overflow or respective owner