log4net versus TraceSource
- by Paul Stovell
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)?