We can configure the "tracing" section at the server level in the ApplicationHost.config file, or at the web application level or directory level in a Web.config file.
Learn how to enable tracing in asp.net application.
Tracing in Asp.net allows you to see diagnostic information about a page request. Tracing enables you to view a page's execution cycle, display diagnostic information at run time, and debug your application.
There are two ways you can enable Tracing in Asp.net:
If you enable tracing, ASP.NET will append a series of execution details about the page request at the bottom of the page.
To enable tracing in your asp.net page simply add
Trace="true" TraceMode="SortByCategory" in your page directive
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WTRWebForm._Default" Trace="true" TraceMode="SortByCategory" %>
TraceMode is optional, ="Default | SortByCategory | SortByTime"
After enabling Trace on your page, simply page F5 to refresh the page, you will be able to see the list of tables appearing with following headers.
Instead of enabling tracing for one particular page, you also can enable tracing for entire application. If you do that, every page in your application will display the trace information.
To understand the impact of application level tracing let’s remove the page level tracing first.
Now, open your web.config file and add the following
<trace /> tag inside the system.web tag
<system.web> <trace enabled="true" pageOutput="true" requestLimit="30" localOnly="false"/> </system.web>
Now if you check all the pages in your application has been trace enabled
Notice, there are few additional parameters in above trace tag.
|PageOutput||Default is false. If true then it will display trace both in pages and in the trace viewer (trace.axd)|
|RequestLimit||Default is 10, Indicate the number of trace requests to store on server|
|LocalOnly||Default is true, if true then the trace viewer (trace.axd) available only on the host Web server|
Learn more about How to deal with tracing in asp.net application.