TraceFailedRequestsSection 类

表示失败请求跟踪配置节。

语法

class TraceFailedRequestsSection : ConfigurationSectionWithCollection  

方法

下表列出了 TraceFailedRequestsSection 类公开的方法。

名称 说明
添加 (继承自 ConfigurationSectionWithCollection。)
清除 (从 ConfigurationSectionWithCollection 继承。)
Get (从 ConfigurationSectionWithCollection 继承。)
GetAllowDefinition (继承自 ConfigurationSection。)
GetAllowLocation (从 ConfigurationSection 继承。)
删除 (从 ConfigurationSectionWithCollection 继承。)
RevertToParent (从 ConfigurationSection 继承。)
SetAllowDefinition (从 ConfigurationSection 继承。)
SetAllowLocation (从 ConfigurationSection 继承。)

属性

下表列出了 TraceFailedRequestsSection 类公开的属性。

名称 描述
Location (继承自 ConfigurationSection。)一个键属性。
Path (继承自 ConfigurationSection。)一个键属性。
SectionInformation (从 ConfigurationSection 继承。)
TraceFailedRequests 一个由 TraceUrl 值组成的读/写数组,这些值用于配置特定请求类型(例如 *.aspx)的跟踪。

子类

此类不包含子类。

注解

此类对应于 ApplicationHost.config 中的 <traceFailedRequests> 节。

示例

以下示例列出了默认网站的 LocationPathTraceFailedRequest 属性。

' 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  
  

继承层次结构

ConfigurationSection

ConfigurationSectionWithCollection

TraceFailedRequestsSection

要求

类型 描述
客户端 - IIS 7.0(在 Windows Vista 上)
- IIS 7.5(在 Windows 7 上)
- IIS 8.0(在 Windows 8 上)
- IIS 10.0(在 Windows 10 上)
服务器 - IIS 7.0(在 Windows Server 2008 上)
- IIS 7.5(在 Windows Server 2008 R2 上)
- IIS 8.0(在 Windows Server 2012 上)
- IIS 8.5(在 Windows Server 2012 R2 上)
- IIS 10.0(在 Windows Server 2016 上)
产品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 文件 WebAdministration.mof

另请参阅

ConfigurationSectionWithCollection 类
HttpTracingSection 类
TraceAreaElement 类
TraceAreaDefinition 类
TraceProviderDefinition 类
TraceProviderDefinitionsSection 类
TraceUrl 类
TraceUrlAreaSettings 类
为失败的请求创建跟踪规则