In this article, we will look into the HTTP API error log feature of IIS 7/ 7.5, when to use it and how to analyze it. When a connection times out, dropped or a request is orphaned on your website, it will be logged in the HTTP API error log file by IIS under "c:\Windows\System32\LogFiles\HTTPERR\httperr#.log". This file helps us to identify the following kinds of errors:
- Connection time-outs for a pending request.
- Orphaned requests when w3wp.exe crashes or stops unexpectedly, while there are pending queued requests.
- Error responses to clients like parser errors.
Let's look at the following sample HTTPERR#.LOG file:
It shows date, time, client's IP, port as well the s-reason field that shows specific error types, like BadRequest, Connection_Dropped and the following is the explanation for that field's value:
s-reason |
Description |
AppOffline |
A service unavailable error occurred (an HTTP error 503). The service is not available because application errors caused the application to be taken offline. |
AppPoolTimer |
A service unavailable error occurred (an HTTP error 503). The service is not available because the application pool process is too busy to handle the request. |
AppShutdown |
A service unavailable error occurred (an HTTP error 503). The service is not available because the application shut down automatically in response to administrator policy. |
BadRequest |
A parse error occurred while processing a request. |
Client_Reset |
The connection between the client and the server was closed before the request could be assigned to a worker process. The most common cause of this behavior is that the client prematurely closes its connection to the server. |
Refer here for a complete list of values for the s-reason field. This field will help us to understand what exactly caused the problem like Application Pool is down or is it a Bad request or a connection timed out.
We can use the Log Parser to better analyze HTTPERR#.LOG files. Open the Log Parser and point to the log file as shown below:
Go to the library and filter it by httperr as shown below:
Let's find abandoned requests by selecting "HTTPERR: Abandoned Requests" and hitting F5 to execute the query:
Analyzing HTTPERR#.LOG with the Log parser will help us to identify connection time-outs, orphaned requests, bad requests and so on quickly.