The attributes of the element of a trace
Properties |
Description |
Enabled |
whether to enable application tracing . In order to use the Trace.axd Viewer, you must enable tracing. By default, the Trace.axd Viewer is added to the httphandlers element. The optional Boolean property. The default value is false. |
Localonly |
Specifies whether the trace viewer (Trace.axd) is used only for host WEB servers. if false, the trace viewer is available for any computer. By default, the Trace.axd Viewer is added to the httphandlers element. The optional Boolean property. The default value is true. |
MostRecent |
Specifies whether to display the most recent application-level trace output, and whether to discard old trace data that exceeds the limit indicated by Requestlimit. if false, the tracing data for the request is displayed until the limit specified by the requestlimit property is reached. The optional Boolean property. The default value is false. |
Pageoutput |
Specifies whether trace output is rendered at the end of each page. If false, trace output can only be accessed through the trace utility. The optional Boolean property. The default value is false. |
Requestlimit |
Specifies the number of trace requests that are stored on the server. if the limit is reached and the mostRecent property is false, tracing is automatically disabled. The maximum request limit is 10,000. If a value greater than 10,000 is specified, ASP. NET will round it down to 10,000 without giving any hint. The optional Int32 property. The default value is ten. |
TraceMode |
Specifies the order in which trace information is displayed. The optional Tracedisplaymode property. Value: SortByCategory: Specifies the order in which trace information is processed to display trace information. SortByTime: Specifies that trace information is displayed alphabetically based on user-defined categories.The default value is SortByTime. |
writeToDiagnosticsTrace |
Specifies whether to forward the ASP. Trace message to the System.Diagnostics tracking infrastructure so that any listener registered will display the trace message. The optional Boolean property. The default value is false. |
2. Location
Customererrors, configuration-> system.web//This element is placed under <system.web> under <configuration> node
3. Configuration Example
<trace enabled= "true"//Open application trace localonly= "true"//only local can see mostrecent= "true"//Display The most recent application-level trace output pageoutput= "false"//does not render trace output at the end of the page, if rendered, the page code above, the following is the tracking information, the page is messy, also affects access to requestlimit= "10" Keep the last 10 trace information tracemode= "SortByTime"/////////////Do not forward/> Based on user-defined categories in alphabetical order writetodiagnosticstrace= "false"
4. Configure the Processing node program
<trace enabled= "true" localonly= "true" pageoutput= "true" requestlimit= "+" mostrecent= "true"/> Tracesection TS = (tracesection) webconfigurationmanager.openwebconfiguration ("/"). GetSection ("System.web/trace"); Response.Write (TS. REQUESTLIMIT);
Tracesection This class, all similar, is a property that contains individual configuration options.