Freigeben über


How to: View ASP.NET Trace Information with the Trace Viewer

If you have enabled tracing for your application, when any page is requested, the page gathers trace information and executes any trace statements that it contains. You can view the trace output in the trace viewer. The trace viewer enables you to choose a specific request from the pages that have been requested from your application.

NoteNote

When you enable tracing for an application, you can display trace output in any page in the application by setting the pageOutput attribute of the trace element to true in the Web.config file.

If multiple requests have arrived for an application that has tracing enabled, the trace viewer lists the requests in the order in which they were processed. The information on the opening page of the trace viewer includes the time of the request, the file requested, the status code of the request, the HTTP verb associated with the request, and a View Details link that enables you to see more information about the request. The number of requests available will not exceed the requestLimit setting that you specified in the Web.config file.

The following screen shot shows a trace viewer that has had seven requests to its application since tracing was enabled.

Trace viewer

Trace Viewer Image

To view trace details for a specific request

  1. Navigate to Trace.axd in the root of your application.

    For example, if the URL for your application is https://localhost/SampleApplication, navigate to https://localhost/SampleApplication/trace.axd to view the trace information for that application.

  2. Select the View Details link for the request that you want to investigate.

To clear requests from the trace viewer

  1. Navigate to Trace.axd in the root of your application.

  2. Select the clear current trace link to remove all the requests stored in the trace viewer.

    NoteNote

    If the mostRecent attribute of the trace element is false, then the trace viewer tracks requests only up to the number of requests defined by the requestLimit attribute. In that case, you cannot view requests made after the request limit is reached. Alternatively, you can set the mostRecent attribute to true so that the most recent tracing data is shown and older tracing data that exceeds the limit defined by the requestLimit attribute is discarded.

See Also

Tasks

How to: Enable Tracing for an ASP.NET Page
How to: Enable Tracing for an ASP.NET Application

Other Resources

ASP.NET Tracing