Tracing in ASP.NET application (trace.axd)
You can enable tracing for an entire application in the Web.config file in the application’s root directory. By default, application-level tracing can be viewed only when accessing the website from the webserver browser; and that’s a good thing, you don’t want anyone be able to see your application’s trace!
- First thing to do is to enable tracing for the application by defining it in the Web.config file in the application’s root directory, like below:
<configuration> <system.web> <trace enabled="true" requestLimit="40" localOnly="false" /> </system.web> </configuration>
The trace options are:
true if tracing is enabled for the application; otherwise, false. The default is false.
true if trace information is displayed both on an application’s pages and in the .axd trace utility; otherwise, false. The default is false.
Pages that have tracing enabled are not affected by this setting.
Number of trace requests to store on the server. The default is 10.
Indicates whether trace information is displayed in the order in which it was processed (SortByTime) or alphabetically by user-defined category (SortByCategory). The default is SortByTime.
true if the trace viewer (Trace.axd) is available only on the host Web server; otherwise, false. The default is true.
For example, if the URL of the application is ‘http://localhost/Application’, the URL to trace will be ‘http://localhost/Application/trace.axd’
Or enable the trace directly in a specific page:
<%@ Page Language="VB" Trace="true" requestLimit="40" localOnly="false" %>
Leave a Reply