Tracing Overview
To enable tracing for a page, include the following directive at the top of the page code:
Trace statements can also be organized by category, using the TraceMode attribute of the Page directive. If no TraceMode attribute is defined, the default value is SortByTime.
• Page-level Tracing: At the page level, developers can use the TraceContext instrinsic to write custom debugging statements that appear at the end of the client output delivered to the requesting browser. ASP.NET also inserts some helpful statements regarding the start/end of lifecycle methods, like Init, Render, and PreRender, in addition to the inputs and outputs to a page, such as form and QueryString variables or headers, and important statistics about the page's execution (control hierarchy, session state, and application state). Because tracing can be explicitly enabled or disabled for a page, these statements can be left in the production code for a page with no impact to the page's performance. Each statement can be associated with a user-defined category for organizational purposes, and timing information is automatically collected by the ASP.NET runtime. The resulting output can be ordered by either time or category.
• Application-level Tracing: Application-level tracing provides a view of several requests to an application's pages at once. Like page-level tracing, it also displays inputs and outputs to a page, such as form and QueryString variables or headers, as well as some important statistics (control hierarchy, session state, and application state). Application-level tracing is enabled through the ASP.NET configuration system, and accessed as a special mapped URL into that application (Trace.axd). When application tracing is enabled, page-level tracing is automatically enabled for all pages in that application (provided there is no page-level directive to explicitly disable trace).
Application-level Trace Logging
The attributes supported in the trace configuration section are listed in the table below:
Value ...............................................................................Description
enabled ...........................................................................Set to true false, indicates whether Tracing is enabled for the application (default is false)
pageOutput .....................................................................Set to true false, indicates whether trace information should be rendered at the end of each page - or only accessible via the trace.axd utility (default is false)
requestLimit ..................................................................Number of trace requests to store on the server (default is 10)
traceMode .....................................................................Set to SortByTime SortByCategory, indicates the display order for Trace messages (default is SortByTime)
localOnly .......................................................................Set to true false, indicates whether Tracing is enabled for localhost users or for all users (default is true)
No comments:
Post a Comment