traceswitch

Where should I put a project- or application-wide TraceSwitch in my design?

Hi, I'm trying to enhance my program with some logging functionality provided by System.Diagnostics. As my Solution consists of several projects, I wanted to create a switch for the whole application and one for every project. Now the question is, how can I achieve this and where should I put the switch definition? Starting with the a...

problem with C# TraceSource, "Cannot access a closed file"

I have a Trace source object with name "MyTraceSource" in class "AppTrace" c# application. TraceSource _traceSource = new TraceSource("MyTraceSource"); I use this TraceSource to generate trace messages. In the application/exe I have used App.config to attach a SourceSwitch and TextWriterTraceListener to the TraceSource with name "...

TraceSwitch and SourceSwitch - what's the difference?

So I'm probably missing the obvious here, but what actually is the difference between the functionality of the TraceSwitch and SourceSwitch classes? They both give identical summary descriptions: Provides a multilevel switch to control tracing and debug output without recompiling your code. Are the Remarks sections are oddly simil...