Clarification on TraceSource/Trace
-
Wednesday, April 05, 2006 7:10 PM
I've been going back forth through the documentation and web searches, and haven't found a concise description of this stuff and hope someone can help me sort out the knots I've developed in my brain.
From what I can tell, the tracesource class essentially replaces the traditional Trace class. If I add a listener to the trace section of my config file, I receive all the trace information to that listener (ie, calls to trace.write, trace.traceerror, etc...). If that same listener is moved into the sources section under a source definition, I don't receive any of the trace information sent via calls to trace.write, etc. I have to make calls directly to that trace source via something like
TraceSource t = new TraceSource("Source Name");
t.TraceInformation(....);
Is there not a way to receive calls to the normal Trace functions via a TraceSource object? Or do you have to make explicit calls via instantiation of a TraceSource object?My second question is about the filter setting. What does the TraceSource compare with its filter? In the only example I can find in the documentation, it looks like its related to the function name or either the name of the TraceSource object, neither of which really makes any sense.
I hope this makes sense to someone else... I've got me head so wrapped around I'm not sure which way is up anymore.
All Replies
-
Thursday, April 06, 2006 12:28 AM
As you said, TraceSource is an "upgraded" Trace system. Mike Rousos wrote a great blog entry while .NET 2.0 was still beta, but it's an excellent explanation of the system (if a bit deep).
http://blogs.msdn.com/bclteam/archive/2005/03/15/396431.aspx
For a more brief explanation, see Robbins' Bugslayer article:

