TraceFailedRequestsLogging Class [IIS 7 and higher]
Configures the trace logging of failed requests for a Web site.
The following table lists the properties exposed by the TraceFailedRequestsLogging class.
A read/write boolean value. true if custom actions are enabled; otherwise, false. The default is false.
For more information about custom actions, see the CustomActionExe property of the TraceUrl class.
A read/write string value that specifies where the log files are saved. The default is "%SystemDrive%\inetpub\FailedReqLogFiles".
A read/write boolean value. true if trace logging of failed requests is enabled for the Web site; otherwise, false. The default is false.
A read/write uint32 value that specifies the maximum number of log files to persist for the Web site. One log file is created for each failed request that is defined. The default is 50.
A read/write uint32 value that specifies the maximum size, in kilobytes, of the log file to save to disk. The default is 512. 0 specifies that no limit is used.
The actual log file size may vary somewhat from the specified size when the memory cache is saved to disk.
The following example displays the properties of the TraceFailedRequestsLogging class, reverses the value of the Enabled property and saves it, and then displays the properties again to reveal the change.
' 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'") ' List the name of each property and display the property values. For Each vProp In oSite.TraceFailedRequestsLogging.Properties_ WScript.Echo vProp.Name & ": " & vProp.Value Next WScript.Echo ' Switch the current value of the Enabled property. oSite.TraceFailedRequestsLogging.Enabled = _ Not(oSite.TraceFailedRequestsLogging.Enabled) ' Save the change. oSite.Put_ ' Display the property names and values again. For Each vProp In oSite.TraceFailedRequestsLogging.Properties_ WScript.Echo vProp.Name & ": " & vProp.Value Next