TraceFailedRequestsSection Class [IIS 7 and higher]

IIS 7.0

Represents a failed-request tracing configuration section.

class TraceFailedRequestsSection : ConfigurationSectionWithCollection

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.)

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).

This class contains no subclasses.

This class corresponds to the <traceFailedRequests> section in ApplicationHost.config.

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

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

Community Additions

ADD
Show: