> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/server/knowledge-base/troubleshooting-articles/failed-request-tracing-with-iis/configuration.md).

# Configuration

There are two methods for configuring the failed request tracing:

* [Using the appcmd.exe command](https://docs.devolutions.net/server/kb/troubleshooting-articles/failed-request-tracing-with-iis/configure-failed-request-tracing/#using-the-appcmdexe-command)
* [Via the IISManager app](https://docs.devolutions.net/server/kb/troubleshooting-articles/failed-request-tracing-with-iis/configure-failed-request-tracing/#via-the-iismanager-app)

### Using the [appcmd.exe command](https://docs.microsoft.com/en-us/iis/get-started/getting-started-with-iis/getting-started-with-appcmdexe)

|                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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"                                       |

{% hint style="info" %}
Note that the steps above only apply to IIS 7.0 or later, and that the commands work best when cmd.exe is run as an administrator.
{% endhint %}

### Via the IISManager app

1. In IIS Manager, expand the root node, expand ***Sites***, then select ***Default Web Site***.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4006_2024_1.png" alt=""><figcaption></figcaption></figure>
2. In the ***Actions*** pane on the right, select ***Failed Request Tracing***.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4007_2024_1.png" alt=""><figcaption></figcaption></figure>
3. Check the ***Enable*** box (mandatory). The ***Directory*** target and ***Maximum number of trace files*** options can be customized (optional). Click ***OK*** when done.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4008_2024_1.png" alt=""><figcaption></figcaption></figure>
4. Expand ***Default Web Site***, then select the website to be traced.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4009_2024_1.png" alt=""><figcaption></figcaption></figure>
5. Double-click on the ***Failed Request Tracing Rules*** icon of the selected website.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4010_2024_1.png" alt=""><figcaption></figcaption></figure>
6. In the ***Actions*** pane on the right, click on ***Add*** to add a new rule.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4011_2024_1.png" alt=""><figcaption></figcaption></figure>
7. Select ***All content (*****)**\*, then click ***Next***.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4012_2024_1.png" alt=""><figcaption></figcaption></figure>
8. Check the ***Status Code(s)*** box, then enter the type of the status code to be traced. In this case, the ***Status code(s)*** is set to monitor everything from codes 400 to 599. Click ***Next*** when done.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4013_2024_1.png" alt=""><figcaption></figcaption></figure>
9. Select the providers of the tracing. For each provider, set the ***Verbosity*** to ***Verbose*** and select all ***Areas***. In this case, the ***WWW Server*** provider was selected.

   <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4014_2024_1.png" alt=""><figcaption></figcaption></figure>
10. Click ***Finish***. The tracing rule is now defined.

    <figure><img src="https://cdnweb.devolutions.net/docs/DVLS4015_2024_1.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devolutions.net/server/knowledge-base/troubleshooting-articles/failed-request-tracing-with-iis/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
