IIS 7.5 Log Request Processing Time

Solution 1:

Enable "Time Taken" in W3C logs

To give a useless but precise and correct answer, here is how you go about logging the timespan each request takes to process:

In the IIS Manager:

  1. In the left pane, expand "Sites"
  2. Select the appropriate web site
  3. In the middle pane, double-click the "Logging" feature
  4. Click "Select Fields"
  5. Make sure that the field "Time Taken ( time-taken )" is checked.

A nice HowTo with screenshots are available at IIS.NET


Enable "Failed Request Tracing" in IIS

That however, will only tell you how many milliseconds the execution of a request took, not why.

To dig deeper into why it's slow, you might benefit from the "Failed Request Tracing" feature:

  1. Make sure you have enabled the Web Server role service called "Tracing". It can be found in Server Manager by selecting the Web Server Role, "Add Role Services" and then checking "Web Server -> Health and Diagnostics -> Tracing"
  2. In IIS Manager, select your Server (top level) in the left pane
  3. Double-click "Failed Request Tracing"
  4. In the "Actions"-pane, click "Add..."
  5. Choose "Custom", and specify an expression that matches the file you want to trace
  6. Although it might seem tempting to choose the "Time taken" condition, it will cause Tracing to stop and generate a trace reports as soon as the limit has been exceeded, so use a Status Code condition instead.
  7. Leave the "Providers" all checked, and press Finish.

Now you have a proper tracing rule in place, all you need to do is to enable site tracing on the Web Site you are having problems with:

  1. In the left pane, expand "Sites"
  2. Select the appropriate web site
  3. In the middle pane, double-click the "Failed Request Tracing" feature
  4. You will see the rule you just configured in the list, as "Inherited"
  5. In the right-hand pane, click "Edit Site Tracing", check "Enable" and press OK.

All the failed request reports will appear in the folder specified in step 5 (default location: %SystemDrive%\inetpub\logs\FailedReqLogFiles)

Voila