Edit

Share via


Enable-WebRequestTracing

Enables request tracing for a website.

Syntax

Default (Default)

Enable-WebRequestTracing
    [[-Name] <String>]
    [-Directory <String>]
    [-MaxLogFiles <UInt32>]
    [-MaxLogFileSize <UInt32>]
    [-CustomActions]
    [-StatusCodes <String>]
    [<CommonParameters>]

Description

The Enable-WebRequestTracing cmdlet enables request tracing, and automatically configures a website rule that traces responses that have a status value between 400 and 600.

Examples

Example 1: Enable request tracing for the default website

IIS:\> Enable-WebRequestTracing -Name "Default Web Site"

This command enables request tracing for the default website, which also automatically creates a rule that traces status code 500 errors.

Parameters

-CustomActions

Specifies an action to take when a request tracing log file is generated.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Directory

Specifies the directory in which request tracing log files are stored.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MaxLogFiles

Specifies the maximum number of log files to store.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MaxLogFileSize

Specifies the maximum file size of a single request tracing log file.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of the site for which tracing is enabled.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StatusCodes

Specifies the status codes for which a default request tracing rule is configured. The default code value is 500.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.