The following steps are applicable on IIS 7.0 or higher.
The following steps describe how to configure the Failed Request Tracing.
Click on the link below to expand the section to configure the Failed Request Tracing using appcmd.exe command.
Enable and configure Failed Request Tracing |
---|
appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].traceFailedRequestsLogging.enabled:True" /commit:apphost |
appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].traceFailedRequestsLogging.maxLogFiles:10" /commit:apphost |
appcmd.exe set config -section:system.applicationHost/sites "/[name='Default Web Site'].traceFailedRequestsLogging.directory:%SystemDrive%\inetpub\logs\FailedReqLogFiles" /commit:apphost |
appcmd.exe set config "Default Web Site" -section:system.webServer/tracing/traceFailedRequests /+"[path='*']" |
appcmd.exe set config "Default Web Site" -section:system.webServer/tracing/traceFailedRequests /+"[path='*'].traceAreas.[provider='WWW Server',areas='Rewrite',verbosity='Verbose']" |
appcmd.exe set config "Default Web Site" -section:system.webServer/tracing/traceFailedRequests /[path='*'].failureDefinitions.statusCodes:"400-599" |
- Open IIS Manager, expand the root node, expand Sites and then select Default Web Sites.
- In Actions pane on the right, select Failed Requests Tracing....
- Select the Enable check box and then click OK. The Directory target and the Maximum number of trace files can be modified.
- Expand Default Web Site and select the Web site to be traced.
- Double click on the Failed Request Tracing Rules icon of the selected Web Site.
- In the Actions pane on the right, click on Add... to add a new rule.
- Select All content (*) and click Next.
- Select the Status Code(s) check box. Enter the type of the status code to be traced, in this case type in the Status code(s) is set to monitor everything between code 200 to 599. Set the appropriate status code and click Next.
- The last setting is to select the providers of the tracing. Select WWW Server. For each of them, set the Verbosity to Verbose. Finally, check Rewrite and click Finish.
- The tracing rule is now defined.