IIS failed Request Tracing rules

Source: Internet
Author: User

If you want to use this feature, you must first start the Windows feature:

  

With the failed Request tracing feature, you can capture the corresponding XML-formatted log in the event of a problem, eliminating the need to reproduce the problem to begin troubleshooting. In addition, you can define the application's failure criteria and configure the trace events to be logged based on the URL.

Failed request tracing can be configured at two levels:

[1] At the site level, you can enable or disable tracing and configure log file settings.

[2] At the application level, you can specify failure conditions when capturing trace events, and you can also configure trace events that should be captured in the log file entries.

(i) View a list of failed request tracking rules

To manage tracing rules for failed requests, you can view a list of all failed request tracking rules that contain a specific configuration level. You can sort the list by path, by the associated trace provider, by the HTTP status code, by the time or scope (local or inherited) in which the request was processed. In addition, you can group rules by scope to quickly see which rules apply to the current configuration level, and which rules are inherited from the parent.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the features view, double-click Failed Request tracing rules.

Alternatively, you can do this by command line, using the following syntax to view a list of failed request tracking rules:

Appcmd Configure Trace "string"

The variable string is the name of the site for which you want to view the list of failed request tracking rules.

(ii) Enable trace logging for failed requests

If you want IIS to record information about requests that failed to provide site or application content, you can enable trace logging for failed requests. After enabling trace logging for failed requests, IIS provides a targeted log that can be found without the hassle of finding it in a list full of unrelated log entries to find the failed request. In addition, you can resolve them without having to reproduce the error.

You can configure the location of the log file, the maximum number of log files to keep, and the maximum size of the log file.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the Connections pane, click Sites.

3. In the features view, select the site for which you want to enable trace logging.

4. In the actions pane, under Configuration, click Failed Request tracing.

5. In the edit Web site failed Request Tracking Settings dialog box, select Enable to enable logging for the site.

6. In the Directory text box, type the path you want to use to store the log files, or click the browse button (...) to find the desired location on your computer. The default path is%systemdrive%\inetpub\logs\failedreqlogfiles.

Note: It is a best practice to store log files, such as log files for failed request tracing, in a directory other than systemroot.

7. In the maximum number of trace files text box, type the maximum number of trace log files that you want to keep, and then click OK.

(iii) Disabling failed request tracing logging

You can disable site-level trace logging for failed requests when you no longer need to track failed requests to applications on the site or site. After disabling trace logging for failed requests, IIS no longer creates trace logs to record any requests for that site that are defined as failure as a failure definition.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the Connections pane, click Sites.

3. In Features view, click the site for which you want to disable trace logging.

4. In the actions pane, under Configuration, click Failed Request tracing.

5. In the edit Web site failed Request Tracking Settings dialog box, clear Enable, and then click OK.

(iv) Create a tracking rule for failed requests

If a request sent to the server fails or takes too long, you can define a failed request tracking rule that captures the trace events for this request and logs them when they occur without having to reproduce the corresponding error. The event is written to the trace log only if the request exceeds the time interval allocated to complete processing, or if the specified HTTP state and child status code combination is generated for the response. The trace log contains only information that is specific to the failed request. You can find the information you need about a particular failed request without having to review the large log file that contains each request.

Note: You must enable trace logging before you can create a trace log for failed requests. For more information about how to enable trace logging, see IIS 7.0: Enable trace logging for failed requests.

Note: When you add a configuration setting, the setting is added at the local level and at all child levels that inherit the setting.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the features view, double-click Failed Request tracing rules.

3. On the failed Request Tracing Rule page, click Add in the Actions pane.

4. In the Add Failed Request Tracing Rule dialog box, in the Specify what to trace area, select:

-All content (*)-when you want to track all files in the directory.

-ASP. *.aspx-When you want to track all the. aspx files in the directory.

-ASP (*.asp)-when you want to track all the. asp files in the directory.

-Custom-when you want to define a failure for a custom content set, such as "Xyz.exe" or "*.jpg". It can contain a maximum of one wildcard character and must be in the directory where the failed request definition is set.

5. Click Next.

6. In the Add Failed Request Tracing Rule dialog box, in the Define tracking criteria area, select one or more of the following conditions to track:

-Status code-enter the status code to be traced. You can enter multiple comma-delimited status codes in this list. You can also use sub-status codes to subdivide status codes, such as "404.2, 500".

-Elapsed time-the maximum time (in seconds) that the input request should take.

-Event Severity-Select the severity level you want to track from the event severity drop-down list. You can select error, critical error, or warning.

Note: If all conditions are specified, the first condition that is met will generate the failed request trace log file.

7. Click Next.

8. In the Add Failed Request Tracing Rule dialog box, under Providers in the Select Trace providers area, select one or more of the following trace providers:

-ASP-When you want to track the start and completion of an ASP request execution operation.

-ASPNET-When you want to see the situation where the request is transferred and transferred out of managed code. This includes *.aspx requests.

-ISAPI extension-when you want to track when requests go into and out of the ISAPI extension process.

-WWW server-when you want to track requests through the IIS worker process.

9. In the Add Failed Request Tracing Rule dialog box, in the Select Trace Provider area, under Verbosity, select one or more of the following levels of detail:

-General-Provides information about the requested activity context, for example, the General_request_start event that logs the requested URL and predicate into the log.

-Critical error-Provides information about an operation that can cause the process to exit or will cause the process to exit.

-Error-Provides information about a component that has encountered an error and cannot continue processing the request. These errors usually indicate a server-side problem.

-Warning-Provides information about a component that encounters an error but can continue to process the request.

-Information-Provides general information about the request.

-Details-Provides detailed information about the request. This is the default selection.

10. If you selected the "ASPNET" Trace provider in step 8th, under Zones in the Select trace providers area of the Add Failed Request Tracing Rule dialog box, select one or more of the following functional areas to be tracked by this provider:

-Structure-when you want to track events that are primarily related to entering and leaving the various parts of the ASP.

-module-When you want to track the events that are logged when a request enters and leaves each HTTP pipeline module.

-page-when you want to generate a trace event that corresponds to a specific ASP. NET page related event (for example, Page_Load, etc.).

-AppServices-When you want to track events that are logged as part of the new application services feature.

11. If you selected the WWW server trace provider in step 8th, under Zones in the Select trace providers area of the Add Failed Request Tracing Rule dialog box, select one or more of the following functional areas to be tracked by this provider:

-Authentication-when you want to track authentication attempts, such as tracking the authenticated user name, authentication scheme (anonymous, basic, and so on), and the results of the authentication attempt (success, failure, error, and so on).

-Security-when you want to generate a trace event when the IIS server rejects a request for security-related reasons, such as a request to deny a client access to a resource.

-Filter-When you want to determine when the ISAPI filter is processing the request.

-Staticfile-When you want to track the time it takes to complete a static file request.

-CGI-when you want to generate a trace event in case of a request for a CGI file.

-Compression-when you want to generate a trace event in response to a compressed response.

-Cache-When a trace event is generated for the cache operation associated with the request.

-Requestnotifications-When you want to capture all request notifications when entering and exiting.

-Modules-when you want to track events that are logged when a request enters and leaves each HTTP pipeline module, or when you want to capture a tracking event for a managed module.

12. Click Finish.

(v) Edit failed request tracking rules

When you want to change the failure definition for a rule, you can change the failed request tracking settings. You can also change these settings when you want to collect additional information about failed requests, such as changing the length of the response to wait before the request is treated as a failed request.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the features view, double-click Failed Request tracing rules.

3. On the failed Request Tracing Rule page, click the rule that you want to change, and then click Edit in the Actions pane.

4. In the Specify what to Trace dialog box, click Next.

5. You can also perform one or more of the following actions in the Define Trace Conditions dialog box:

-Change the status code in the Status Code text box to track the failure of the changed status code.

-Change the elapsed time (in seconds) and type the time interval in the elapsed time (seconds) text box.

-Change the event severity by selecting a new severity from the event severity drop-down list, and then click Next.

6. You can also change the provider by performing one or more of the following actions in the Select Trace Provider dialog box:

-If you want to configure IIS to track ASP requests, click ASP.

-If you want to configure IIS to track ASP. NET requests, click ASPNET.

-If you want to configure IIS to track WWW server requests, click WWW Server.

-If you want to configure IIS to track ISAPI requests, click ISAPI Extensions.

7. You can also click a provider to change its verbosity level.

8. Under Provider properties, in the Verbosity drop-down list, click a verbosity level.

9. Repeat steps 7th and 8th for each provider selected in the Select Trace Provider dialog box and you want to change the verbosity level.

10. You can also click a provider to change the area that you want to track.

11. Under Region, select the area that you want this provider to track.

12. Repeat steps 10th and 11th for each provider that you select in the Select Trace Provider dialog box and change the area that you want to track.

13. Click Finish.

Note: You must specify at least one trace provider to enable the Finish button.

(vi) Delete failed request tracking rules

If you no longer need to track a specific request failure, you can delete the tracing rule for the failed request. You can delete a failed request tracking rule at the local level, or you can delete a failed request tracking rule that inherits from the parent level.

1. Open IIS Manager and navigate to the level you want to manage.

2. In the features view, double-click Failed Request tracing rules.

3. On the failed Request Tracing Rule page, click the trace rule that you want to delete to select it.

4. In the actions pane, click Delete, and then click Yes.

IIS failed Request Tracing rules

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.