I'm currently migrating from log4net as a logging framework to the System.Diagnostics
namespace in order to use 1) a .net built-in framework already available and b) use it's powerful features like activity tracing.
With log4net, I'm used to request the loggers on a class-based way e.g.
private readonly ILog Logger = LogManager.GetLogger(typeof(MyClass).Name);
However with the TraceSource
, it seems like you have to configure each trace source manually in app.config in order to use it. Isn't there a way to create some shared listeners and just use them, with 'global filters' for the TraceEventType
etc. (e.g. EventLogListener
handles Warning/Error, when property "XY" is set, a console listener is active, else log to file etc.)