Compartilhar via


<trace> Element

Configures the ASP.NET trace service.

<configuration>
   <system.web>
      <trace>

<trace enabled="true|false"
       localOnly="true|false"
       pageOutput="true|false"
       requestLimit="integer" 
       traceMode="SortByTime|sortByCategory"/>

Optional Attributes

Attribute Option Description
enabled     Specifies whether tracing is enabled for an application.
    true Indicates that tracing is enabled. Trace must be enabled in order to use the Trace.axd viewer.
    false Indicates that tracing is not enabled. The default is false.
localOnly true Indicates that the trace viewer (Trace.axd) is available only on the host Web server. The default is true.
    false Indicates that the trace viewer is available from any computer.
pageOutput     Specifies whether trace output is rendered at the end of each page.
    true Indicates that trace output is appended to each page.
    false Indicates that trace output is accessible through the trace utility only. The default is false.
requestLimit     Specifies the number of trace requests to store on the server. The default is 10. If the limit is reached, trace is automatically disabled.
traceMode SortByTime Indicates that trace information is displayed in the order it is processed. The default is SortByTime.
    SortByCategory Indicates that trace information is displayed alphabetically by user-defined category.

Example

The following example specifies tracing configuration settings.

<configuration>
   <system.web>
      <trace enabled="false" 
             pageOutput="true"
             requestLimit="15"/>
   <system.web>
</configuration>

Requirements

Contained Within: <system.web>

Web Platform: IIS 5.0, IIS 5.1, IIS 6.0

Configuration File: Machine.config, Web.config

Configuration Section Handler: System.Web.Configuration.TraceConfigurationHandler

See Also

ASP.NET Configuration | ASP.NET Settings Schema