- Configuration
- Trace Output
- Setting Trace Messages
- Trace Viewer
- Tracing via Components
- Tips for Using Trace Information
- Summary
Tips for Using Trace Information
Now that you have all this trace information sitting in front of you, how do you use it to your best advantage? Well, that really depends. Most of the trace information presented (such as cookies, headers, and server variables) was available to you in traditional ASP. It just wasn't neatly packaged like it is in the Trace Viewer. You can use that information just as you previously did.
The true power of ASP.NET tracing is in the Trace Information section. It enables you to see when each part of your ASP.NET page is processing and determine how long it takes to process. This can be crucial to the process of finding performance bottlenecks in your code. It can also help you solve mysteries about why certain code is not processing correctly. Often, the code isn't being executed in the same order that you thought it was. Or, maybe the code is being executed multiple times by accident. These nuances, which were tough to discover in traditional ASP, become fairly obvious when observing the contents of the Trace Information section of the trace output.
Application-level tracing, if used properly, can greatly reduce the amount of time and effort expended on debugging your ASP.NET web applications. For instance, you could turn on tracing but set the pageOutput attribute of the <trace> XML element in the web.config file to false. Then you could let some of the potential users of your web application try it out. You can record lots of information about what they are doing and what is going wrong with their experience, all behind the scenes. This can help you to determine which particular scenarios cause errors.