
Tracing | 227
Error Handling
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Application-Level Tracing
ASP.NET provides the ability to enable tracing at the application level through the
<trace> element in web.config. Application-level tracing makes it possible to
disable tracing in a single location in your application and makes it easier to
enable tracing for multiple pages. Example 10-8 shows a web.config file with
tracing enabled at the application level.
While the <trace> element allows you to enable or disable tracing
at the application level, the page-level Trace attribute overrides the
setting in web.config. Thus, if any pages have the Trace attribute set
to True, disabling tracing at the application level will not disable
tracing for these pages.
Figure 10-8. Page-level tracing
Example 10-8. The <trace> element
<configuration>
<system.web>
<trace enabled="true"
localOnly="true"
pageOutput="true"
requestLimit="15"
traceMode="SortByCategory" />
<system.web>
</configuration>