Levels of Tracing, Part 1
Tracing is a mechanism for collecting error information and other processing milestones from across multiple components within an application. Tracing is generally not enabled by default. Rather, you have to elect through application configuration or coding to receive trace events from one or more trace sources. For example, the System.ServiceModel trace source is where many of the WCF trace events originate. Then, you need to connect the trace source to a trace listener. The trace listener is the active agent that does something with the trace events, such as writing them to durable storage.
A trace source is filtered to provide a variety of different levels of trace events. Trace levels are a nested set of classes of trace events. For example, the topmost trace level, Critical, only contains trace events that indicate the application has failed, such as uncatchable exceptions. The next trace level, Error, contains all of the trace events for the Critical trace level plus some more events. In this case, the Error trace level contains trace events for any type of exception whether or not the exception actually indicates application failure. By the time you get to the bottommost trace level, Verbose, it contains an extremely large amount of trace events.
- Critical: unhandled exceptions, application startup failures
Error: all exceptions
- Warning: error conditions that are not exceptions, such as timeouts and authorization failures
- Information: successful application actions, such as creating a channel
- Verbose: individual application steps, such as processing a message header
Outside of these trace levels is the special ActivityTracing flag that tracks the transfer of control between activity boundaries. Two other special trace levels are the Off flag that contains no trace events and the All flag that is equivalent to the Verbose trace level with the ActivityTracing flag.
Next time I'll cover configuring trace sources and when to use each trace level.
Comments
- Anonymous
May 17, 2009
Today's article continues the series on tracing and message logging with a look at the different message