TraceFailedRequestsLogging Class1

Configures the trace logging of failed requests for a Web site.

Syntax

class TraceFailedRequestsLogging : EmbeddedObject  

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the TraceFailedRequestsLogging class.

Name Description
CustomActionsEnabled A read/write boolean value. true if custom actions are enabled; otherwise, false. The default is false. Note: For more information about custom actions, see the CustomActionExe property of the TraceUrl class.
Directory A read/write string value that specifies where the log files are saved. The default is "%SystemDrive%\inetpub\FailedReqLogFiles".
Enabled A read/write boolean value. true if trace logging of failed requests is enabled for the Web site; otherwise, false. The default is false.
MaxLogFiles 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.
MaxLogFileSizeKB 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. Note: The actual log file size may vary somewhat from the specified size when the memory cache is saved to disk.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the TraceFailedRequestsLogging property of the Site class and the SiteElementDefaults class.

Example

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  
  

Inheritance Hierarchy

EmbeddedObject

TraceFailedRequestsLogging

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

EmbeddedObject Class
Site Class
SiteElementDefaults Class
TraceUrl Class