IIS Troubleshooting (1/2)

Introduction

In IIS 7 a new feature was introduced that allows tracing of requests [1] to simplify troubleshooting.

Installing and enabling tracing

This feature is not installed by default. It can be installed from the Programs and Features section of the Control Panel as shown in Figure 1.

Enabling the IIS Tracing Feature
Figure 1: Enabling the IIS Tracing Feature

Once the Tracing feature is installed the "Failed Requests Tracing Rules" icon is available in the IIS Manager as shown in Figure 2. Note that any request can be traced and not only failed requests despite what the name suggests.

Failed Requests Tracing Rules Icon in the IIS Manager
Figure 2: Failed Requests Tracing Rules Icon in the IIS Manager

Installing the module is not enough. Tracing needs to be enabled for each site for which requests need to be traced [2] [3] . There are two ways to do so from the IIS Manager:

  1. From the Advanced Settings dialog for the site.
  2. From the new shortcut added to the Actions pane.

Both ways are detailed below.

After the Tracing feature is installed the "Advanced Settings" dialog for each site contains an additional field named "Failed Request Tracing" that can be used to configure the tracing. This is shown on Figure 3 below.

Advanced Settings with Tracing Settings
Figure 3: Advanced Settings with Tracing Settings

In addition to the new field in the "Advanced Settings" dialog a new "Failed Request Tracing" action is available in the Configure section of the Actions pane as shown on Figure 4.

Enable Failed Request Tracing
Figure 4: Enable Failed Request Tracing

Selecting this action launches the dialog shown on Figure 5.

Failed Request Tracing Settings
Figure 5: Failed Request Tracing Settings

Creating a Rule

Now that we have enabled tracing, we can add a tracing rule. We can either create a tracing rule that applies to all sites (only sites with tracing enabled will apply the rule of course) or for a single website. To create a rule that applies to all sites with tracing enabled we click on the "Failed Requests Tracing Rules" icon in the settings for the entire server. For a rule that applies to only one site we select that site and then click on the "Failed Requests Tracing Rules".

Clicking on the icon displays the list of rules. It is initially empty. This is shown in Figure 6.

List of Tracing Rules
Figure 6: List of Tracing Rules

We select the Add action from the Actions pane. This launches the rule creation wizard which has 3 screens shown in figures 7, 8 and 9.

For our first example we will actually trace a successful request to see what we can expect when a request is executed normally. For this we leave all the wizard's default choices as is except for the status code in the second dialog (Figure 8) which we set to "200" as that is the status code returned by a successful request in general.

Add Failed Request Tracing Rule Dialog (1)
Figure 7: Add Failed Request Tracing Rule Dialog (1)
Add Failed Request Tracing Rule Dialog (2)
Figure 8: Add Failed Request Tracing Rule Dialog (2)
Add Failed Request Tracing Rule Dialog (3)
Figure 9: Add Failed Request Tracing Rule Dialog (3)

After we close the wizard the list of rules now lists our new rule as shown on Figure 10.

List of Tracing Rules
Figure 10: List of Tracing Rules

Now that we have a tracing rule, let's see what happens when it is matched. This is covered on the next page.

References

  1. iis.net: Troubleshooting Failed Requests Using Tracing in IIS 7
  2. TechNet: Enable Trace Logging for Failed Requests (IIS 7)
  3. MSDN Blogs: Enable and Activate Failed Request Tracing Rules

Further Reading

  1. Using Tracing with the IIS URL Rewrite module

blog comments powered by Disqus

Copyright(c) 2006-2017 Xavier Leclercq | Privacy policy

Home
Contact Us
Search