您现在的位置:主页 > 情感两性 > Troubleshooting Failed Requests Using Tracing in IIS 7

Troubleshooting Failed Requests Using Tracing in IIS 7

2019-01-11 21:10

Troubleshooting Failed Requests Using Tracing in IIS 7

In this article

by IIS Team

Introduction

Request-based tracing is available both in stand-alone IIS Servers and on Azure wep apps and provides a way to determine what exactly is happening with your requests and why, provided that you can reproduce the problem that you are experiencing. Problems like poor performance on some requests, or authentication-related failures on other requests, or the server 500 error from ASP or ASP.NET can often be difficult to troubleshoot--unless you have captured the trace of the problem when it occurs. the following article discusses failed request tracing on IIS Server. For information about doing this with Azure web apps click here

Failed-request tracing is designed to buffer the trace events for a request and only flush them to disk if the request "fails," where you provide the definition of "failure". If you want to know why you're getting 404.2 error messages or request start hanging, use failed-request tracing.

The tasks that are illustrated in this article include:

Enabling the failed-request tracing module

Configuring failed-request tracing log-file semantics

Defining the URL for which to keep failed request traces, including failure definitions and areas to trace

Generating the failure condition and viewing the resulting trace

Prerequisites Install IIS

You must install IIS 7 or above before you can perform the tasks in this article. Browse to to see if IIS is installed. If IIS is not installed, see Installing IIS on Windows Server 2008 for installation instructions. When installing IIS, make sure that you also install the following:

ASP.NET (under World Wide Web Services - Application Development Features - ASP.NET)

Tracing (under World Wide Web Services - Health and Diagnostics - Tracing)

Log In as Administrator

Ensure that the account that you use to log in is the administrator account or is in the Administrators group.

Note

Being in the Administrators group does not grant you complete administrator user rights by default. You must run applications as Administrator, which you can do by right-clicking on the application icon and selecting Run as administrator.

Make a Backup

You must make a backup of the configuration before doing the following tasks.

To make a backup of the configuration:

Click Start -> All Programs -> Accessories.

Right-click Command Prompt, and then click Run as administrator.

Troubleshooting Failed Requests Using Tracing in IIS 7

In a command prompt, run the following command:

%windir%\system32\inetsrv\appcmd add backup cleanInstall

Create Sample Content

Navigate to %systemdrive%\inetpub\wwwroot.

Move the content to a secure location (in case you want to restore the existing content) or delete it.

Create a blank file and name it test.asp.

In the command prompt, navigate to the test.asp file in \inetpub\wwwroot.

In the test.asp file, paste the following content:

<h2>Failed Request Tracing Lab</h2><br> <br>Today's date is <% response.write(Date()) %>

Disable ASP

ASP must be disabled for this task. ASP is disabled only as an example and for the purposes of the tasks in this article.

To disable ASP:

Open IIS Manager.

Double-click ISAPI and CGI Restrictions.

Troubleshooting Failed Requests Using Tracing in IIS 7

Select Active Server Pages. In the Actions pane, click Deny to disable ASP .

Troubleshooting Failed Requests Using Tracing in IIS 7

Enable Failed-Request Tracing

After you enable failed-request tracing, you need to configure where the log files will reside. In this task, you will enable failed-request tracing for the Default Web Site and specify where to put the log files. You will then configure the failure for which to generate failure logs.

Step 1 : Enable Failed-Request Tracing for the Site and Configure the Log File Directory

Open a command prompt with administrator user rights.

Launch inetmgr.

In the Connections pane, expand the machine name, expand Sites, and then click Default Web Site.

In the Actions pane, under Configure, click Failed Request Tracing鈥