TraceFailedRequestsSection Class
Represents a failed-request tracing configuration section.
Syntax
class TraceFailedRequestsSection : ConfigurationSectionWithCollection
Methods
The following table lists the methods exposed by the TraceFailedRequestsSection
class.
Name | Description |
---|---|
Add | (Inherited from ConfigurationSectionWithCollection.) |
Clear | (Inherited from ConfigurationSectionWithCollection .) |
Get | (Inherited from ConfigurationSectionWithCollection .) |
GetAllowDefinition | (Inherited from ConfigurationSection.) |
GetAllowLocation | (Inherited from ConfigurationSection .) |
Remove | (Inherited from ConfigurationSectionWithCollection .) |
RevertToParent | (Inherited from ConfigurationSection .) |
SetAllowDefinition | (Inherited from ConfigurationSection .) |
SetAllowLocation | (Inherited from ConfigurationSection .) |
Properties
The following table lists the properties exposed by the TraceFailedRequestsSection
class.
Name | Description |
---|---|
Location |
(Inherited from ConfigurationSection .) A key property. |
Path |
(Inherited from ConfigurationSection .) A key property. |
SectionInformation |
(Inherited from ConfigurationSection .) |
TraceFailedRequests |
A read/write array of TraceUrl values that configure the tracing for specific request types (for example, *.aspx). |
Subclasses
This class contains no subclasses.
Remarks
This class corresponds to the <traceFailedRequests>
section in ApplicationHost.config.
Example
The following example lists the Location
, Path
, and TraceFailedRequest
properties for the default Web site.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
' Place the TraceFailedRequestsSection object into a variable by
' using the GetSection method on the Site object.
oSite.GetSection "TraceFailedRequestsSection", oTFRSection
' Echo the path and location information.
WScript.Echo "Path: " & oTFRSection.Path
WScript.Echo "Location: " & oTFRSection.Location
WScript.Echo vbCRLF
' Retrieve and display the values for the TraceFailedRequests property.
For Each oTFR In oTFRSection.TraceFailedRequests
WScript.Echo "Trace URL path: " & oTFR.Path
WScript.Echo String(16 + Len(oTFR.Path), "=")
Set oFD = oTFR.FailureDefinitions
WScript.Echo "Failure Definition Status Codes: " & oFD.StatusCodes
WScript.Echo "Failure Definition TimeTaken: " & oFD.TimeTaken
WScript.Echo "Failure Definition Verbosity Level: " & _
GetVerbosityText(oFD.Verbosity)
WScript.Echo
For Each oTA In oTFR.TraceAreas.TraceAreas
WScript.Echo "Trace Provider: " & oTA.Provider
WScript.Echo "Trace Verbosity Level: " & _
GetVerbosityText(oTA.Verbosity)
If Not (oTA.Provider = "ASP" Or _
oTA.Provider = "ISAPI Extension") Then
WScript.Echo "Trace Areas: " & oTA.Areas
End If
WScript.Echo
Next
WScript.Echo
Next
' Provide text for the verbosity enumeration values.
Function GetVerbosityText(sint32Value)
Select Case sint32Value
Case 0
GetVerbosityText="General"
Case 1
GetVerbosityText="Critical Error"
Case 2
GetVerbosityText="Error"
Case 3
GetVerbosityText="Warning"
Case 4
GetVerbosityText="Information"
Case 5
GetVerbosityText="Verbose"
Case Else
GetVerbosityText ="Undefined Verbosity Level"
End Select
End Function
Inheritance Hierarchy
ConfigurationSectionWithCollection
TraceFailedRequestsSection
Requirements
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
See Also
ConfigurationSectionWithCollection Class
HttpTracingSection Class
TraceAreaElement Class
TraceAreaDefinition Class
TraceProviderDefinition Class
TraceProviderDefinitionsSection Class
TraceUrl Class
TraceUrlAreaSettings Class
Create a Tracing Rule for Failed Requests