Install Failed Request Tracing via Windows Features under Internet Information Services > Health and Diagnostics; 2. Enable it for a specific site in IIS Manager by clicking Enable in Failed Request Tracing; 3. Add rules by specifying request paths and status codes like 404,500 with Verbose level for detail; 4. Review generated XML logs in %SystemDrive%\inetpub\logs\FailedReqLogFiles\ using a browser or IIS Failed Request Viewer; 5. Optionally configure global settings in applicationHost.config for log directory and size, ensuring proper permissions and selective rule usage to manage log volume in production, which together provide comprehensive troubleshooting insight for failed web requests.
Enabling Failed Request Tracing in IIS (Internet Information Services) helps you diagnose issues with specific web requests—especially those that result in HTTP error codes like 404, 500, etc. It provides detailed logs showing each step of the request processing, which is useful for troubleshooting.

Here’s how to enable and configure Failed Request Tracing in IIS:
1. Install Failed Request Tracing (if not already installed)
By default, Failed Request Tracing might not be installed. You need to add it via Windows Features.

Steps:
- Open Server Manager (on Windows Server) or go to Control Panel > Programs > Turn Windows features on or off (on Windows 10/11).
- Navigate to:
Internet Information Services > World Wide Web Services > Health and Diagnostics > Failed Request Tracing
- Make sure the checkbox is selected.
- Click OK to install.
2. Enable Failed Request Tracing at the Site Level
Once installed, you must enable tracing for the specific site.

Steps:
- Open IIS Manager.
- In the Connections pane, select the website you want to monitor.
- Double-click Failed Request Tracing in the main panel.
- Click Enable in the Actions pane on the right.
This creates a
tracing
folder under the site's directory (or logs folder) where log files will be stored unless configured otherwise.
3. Add Failed Request Tracing Rules
Tracing doesn’t log every request by default. You define rules based on status codes or request paths.
Steps:
- With your site selected, click Failed Request Tracing Rules.
- In the Actions pane, click Add…
- Configure the rule:
- Request path: Use
*
to apply to all requests, or specify a file/path (e.g.,*.aspx
,/api/*
). - Status codes: Enter the HTTP status codes you want to trace (e.g.,
404
,500
, or404,500,502
). - Verbosity Level: Choose Verbose for maximum detail (includes all events), or lower levels to reduce log size.
- Request path: Use
Click OK to save the rule.
4. Understanding the Logs
When a request matches your rule:
- IIS generates an XML log file in the configured directory (usually
%SystemDrive%\inetpub\logs\FailedReqLogFiles\
). - Each file contains a timeline of events: authentication, URL rewriting, handler mapping, etc.
- You can open these XML files in a browser or use tools like Log Parser or IIS Failed Request Viewer (part of IIS Diagnostic Toolkit) for better readability.
5. Optional: Set Global Configuration (Advanced)
You can adjust global settings using applicationHost.config
:
- Location:
%windir%\system32\inetsrv\config\applicationHost.config
- Look for the
<tracing>
section. - You can change log directory, maximum log file size, and other settings.
Example:
<tracing enabled="true" directory="D:\IISLogs\FailedRequests" />
Notes:
- Failed Request Tracing can generate a lot of data. Use rules selectively in production.
- Make sure the IIS application pool identity has write permissions to the log directory.
- For troubleshooting 500 errors, combine failed request logs with Windows Event Viewer and regular IIS logs.
That’s it. Once enabled and configured, you’ll get detailed insight into problematic requests. Just trigger the error (e.g., access a missing page), then check the logs.
The above is the detailed content of How to enable Failed Request Tracing in IIS?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To limit the size of client requests, the maxAllowedContentLength parameter can be modified in web.config, such as setting it to 104857600 (100MB), and synchronizing the maxRequestLength of ASP.NET at the same time; to reasonably set the connection timeout time, it can be modified through the IIS manager or appcmd.exe command, with the default of 120 seconds, and the API scenario is recommended to set it to 30-90 seconds; if the request queue is full, you can increase MaxClientConn and QueueLength, optimize application performance, and enable load balancing to relieve stress.

HighCPUusageinIISworkerprocessesistypicallycausedbyinefficientcode,poorconfiguration,orunexpectedtrafficpatterns.Todiagnosetheissue,firstidentifythespecificw3wp.exeprocessusinghighCPUviaTaskManagerorResourceMonitoranddetermineitsassociatedapplication

When configuring dynamic compression in IIS, selecting content types reasonably can improve performance. First enable the dynamic compression module, install and configure web.config or IIS manager through the server manager. Secondly, set appropriate content types, such as HTML, CSS, JavaScript, and JSON, text content is suitable for compression, while pictures and videos are not suitable. Finally, pay attention to the impact of client compatibility and performance, monitor CPU load, client support status and small file compression effects, and adjust the configuration based on actual traffic to obtain the best benefits.

Configuring HTTP response headers in IIS to optimize cache and improve security can be achieved by setting cache-related headers and adding security response headers. 1. Set cache-related headers: By configuring the clientCache element in the web.config file, set the Cache-Control and Expires headers for static resources, for example, use cacheControlMaxAge to specify the cache time, and fine-grained control can also be performed for specific file types (such as .jpg), but avoid HTML page caching for too long. 2. Add security-related headers: Configure X-Content-Type-Optio through customHeaders in web.config

ToenableandcustomizedirectorybrowsinginIIS,firstinstallandenabletheDirectoryBrowsingfeatureviaServerManagerandIISManager;next,customizetheappearanceusingheaderandfooterHTMLsnippets;thenconfiguredefaultdocumentstopreventunintendeddirectorylistings;fin

VirtualdirectoriesandapplicationsinIISdifferinindependenceandconfiguration.1.Virtualdirectoriesactasaliasestoexternalcontent,sharingtheparentsite’sapplicationpoolandconfiguration,idealfororganizingstaticfileswithoutduplication.2.Applicationsrunindepe

SharedconfigurationinIISallowsmultipleserverstouseacentralizedapplicationHost.configfile,ensuringconsistencyacrossawebfarm.1.Itenablesallserverstopointtoasharedconfigurationlocation.2.SetupinvolvesusingaUNCpath,enablingthefeatureinIISManager,andimpor

Strengthening IIS security requires five steps: 1. Disable unnecessary functions and services, such as WebDAV, FTP, etc.; 2. Close the default website and test pages, delete or prohibit access to useless script directories; 3. Configure request filtering rules to prevent illegal extensions, directory traversal and super long URLs, and use URLs to rewrite and hide the real path; 4. Enable HTTPS and force jumps, and set security response headers such as HSTS, X-Content-Type-Options; 5. Regularly update system patches, enable logging and use tools to analyze abnormal access behavior. Through these measures, we can effectively prevent common attack methods such as SQL injection, XSS, directory traversal, and improve the overall security of the server.
