Skip to content

How to Enable IIS Failed Request Tracing Print

  • 0

Failed Request Tracing helps explain where an IIS request fails in the request-processing pipeline. Use a narrow rule for a reproducible problem rather than capturing all traffic indefinitely. The resulting trace can contain application and user details, so access and retention matter.

Prepare a reproducible request

Identify the affected site, URL pattern, time window and HTTP status or duration that characterizes the problem. Reproduce it with a test account where possible. A random production failure is harder to interpret if the trace cannot be tied to a known request.

Confirm that the IIS Tracing role service is installed and that a protected trace directory has sufficient space. Save a configuration backup and record the existing site-level trace settings and any current rules. Do not overwrite another investigation’s rules without coordinating with its owner.

Enable the site-level trace log

In IIS Manager, select the intended website. Open Failed Request Tracing from the Actions pane, enable it and choose the approved directory and file-retention limits. This site-level switch is separate from the rule collection that decides which requests produce traces.

Microsoft stores the logging switch under traceFailedRequestsLogging in the site configuration. The traceFailedRequests collection contains the rules. Mixing these two settings can leave a script apparently configured while no usable trace is written.

Create a focused failure rule

Open the website’s Failed Request Tracing Rules feature and add a rule for the relevant content or URL scope. Select the observed failure status range or a justified elapsed-time condition. Choose the providers and areas needed by the installed application stack.

Start with the smallest useful scope. Capturing every request with maximum detail can create storage pressure and expose more information than the investigation requires. If the application returns its own friendly error with HTTP 200, a rule for 500 responses alone will not match that symptom.

Reproduce once and inspect the result

Send the known test request, note the time and check the trace directory associated with the correct site ID. Confirm that the URL, timestamp and status correspond to the test. Read the sequence of modules and events leading to the failure instead of treating the last visible module as automatically responsible.

Compare the trace with the ordinary IIS request log and application log. A missing trace can mean the rule did not match, the wrong site was selected, logging is disabled or the directory is not writable. Check those conditions before broadening the capture.

Import-Module WebAdministration
Get-Website | Select-Object Name,Id,State,PhysicalPath
Get-ChildItem 'C:\inetpub\logs\FailedReqLogFiles' -Recurse -Filter '*.xml' | Sort-Object LastWriteTime -Descending | Select-Object -First 10 FullName,LastWriteTime

Close the diagnostic window deliberately

After obtaining the needed evidence, disable or remove only the temporary rule and restore the original logging state. Retain traces in the protected incident record for the agreed period, then remove them through the normal data-retention process. Do not leave verbose diagnostic capture active simply because the application is working again.

A useful handover includes the failing request, trace file, relevant application log and the configuration change that resolved it. Validate the actual business operation after the fix and confirm the restricted trace setup no longer adds overhead.

Microsoft references

See Microsoft’s failed-request tracing walkthrough and the site trace-logging settings reference.


Was this answer helpful?

« Back