Tracing as a global service

Topics: CAB & Smart Client Software Factory
Apr 6, 2006 at 4:34 AM
originally posted by: sklett

I'm just getting started with tracing and adding it to my existing CAB APP. In the past I have always made my own "Logging" class, but this time around I decided to try using the built in tracing.

I started off by looking at the Hands On Labs BankTeller app that illustrates using Tracing. From this example, it looks as though you would create a TraceSource for each module (and one for the shell?) plus all supporting config code. At first I didn't think much of this, but now as I implement tracing in my own application I'm realizing that I don't need a separate source for each module. Would tracing be a good use for a service? If I had one service that was added to my Root WorkItem, then everything else could use it.

My other question is how to handle threads and "Global Services" - If I DID have a tracing service and if two threads tried to use it at the same time, how do I handle that?

Thanks for any tips or suggestions.


BTW - "Thread title should contain alphanumeric characters, underscores and spaces only." - is SUPER irritating!