Modifier

Partager via


Enable-WebRequestTracing

Enables request tracing for a website.

Syntax

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.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Directory

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

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-MaxLogFiles

Specifies the maximum number of log files to store.

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-MaxLogFileSize

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

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

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

Type:String
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StatusCodes

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

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False