One
can use trace to explore resource usage on each page, and diagnose problems.
Enabling and configuring
trace facility:
Trace facility can be enabled in
web.config. It can be also enabled via ASP.NET Web Site Configuration tool.
Following
are the ASP.Net trace settings:
|
Web Site Administration Tool
Setting
|
Web.config
|
Description
|
|
Capture Tracing information
|
Enabled
|
Enables tracing.
|
|
Display tracing information on individual
pages
|
pageOutput
|
Displays trace info directly on web page.
|
|
Display trace output for
|
localOnly
|
If true trace info for only local
requests will generated. If false trace info for all requests will be
generated.
|
|
Select the sort order for trace results
|
traceMode
|
By Category or time
|
|
Number of trace requests to cache
|
requestLimit
|
Sets the quantity of items to hold in the
cache.
|
|
Select which trace results to cache
|
mostRecent
|
Retain the latest or old trace results to
meet request Limit.
|
To
enable trace facility in web.config user the following element:
<trace
enabled
= “true”
requestLimit
= “10”
pageOutput
= “false”
traceMode
= “SortByTime”
localOnly
= “true”
mostRecent
= “true”
/>
Viewing
the trace data:
To view the trace output if
pageOutput=”false”, navigate to trace.axd.
http://server/application/trace.axd which displays
cached results. Note for security one
must set pageOutput=”false”.
Trace
Results are categorized in to the following sections.
|
Trace Result Section
|
Description
|
|
Request Details
|
General details about the request.
|
|
Trace Information
|
Performance info relating page cycles,
like request start time & end time.
|
|
Control Tree
|
Displays control info in hierarchy like
size.
|
|
Session State
|
All Session variables and their values.
|
|
Application State
|
All application variables and their
states.
|
|
Request Cookies collection
|
Cookie list passed to server.
|
|
Response Cookies collection
|
Cookie list passed to the browser.
|
|
Header Collection
|
HTTP Headers sent to the server.
|
|
Form Collection
|
Values that are posted back to the
server.
|
|
QueryString Collection
|
Displays Key/value pair of the
collection.
|
|
Server Variables
|
Displays all server variables.
|