Home > ASP.NET Applications > ASP.NET Optimization > ASP.NET Trace Functionality
ASP.NET Web Applications
ASP.NET aids the debugging and testing process by providing a trace capability that does two things when enabled:
- it automatically appends a table of performance data to the end of the page.
- it allows you to insert custom diagnostic messages throughout your code.
Performance data and any tracing messages that you specify are appended to the HTML output stream that is sent to the requesting browser, or to an application’s trace.axd file, which is written in the application’s root directory. This information can help you to clarify errors or undesired results as the framework processes a page request.
Trace statements are processed and displayed only when tracing is enabled, and you can control whether it is displayed to a page, to the trace reader that stores all trace information for requests to your application, or both.
Tracing can be enabled for a single ASP.NET page or an entire application. This section details how to enable tracing for a page or an application, how to interpret the trace information, and how to include custom trace statements in your code.
Content |
- Page-level Tracing
- Explains how to enable tracing for a page, as well as how to include trace statements in page output and how to interpret trace messages for a page.
|
- Application-level Tracing
- Details how you can enable tracing for an entire application through the ASP.NET configuration system. If also describes how to use the trace reader, an HTTP module that you can access with the trace.axd file.
|
- Writing to the Trace Log
- Describes how to use the TraceContext.Write and TraceContext.Warn methods to write statements to the trace log.
|
- Reading the Trace Log
- Details the information available to you when you view trace information that is added to a page or in the application-wide trace viewer application ( trace.axd ).
|