Microsoft KB Archive/820729

= Error logging in HTTP API =

Article ID: 820729

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows Small Business Server 2003 Premium Edition
 * Microsoft Windows Small Business Server 2003 Standard Edition

-



SUMMARY
This article describes the error logging capabilities of Hypertext Transfer Protocol (HTTP) APIs.

Some errors that occur in an HTTP-based application are automatically handled by the HTTP API instead of being passed back to an application for handling. This behavior occurs because the frequency of such errors might otherwise flood an event log or an application handler.

The following topics describe the different aspects of HTTP API error logging:
 * Configure HTTP API error logging

Registry settings control the HTTP API logs errors, the maximum permitted size of log files, and the location of the log files.
 * Format of the HTTP API error logs

The HTTP API creates log files that comply with the World Wide Web Consortium (W3C) log file conventions. You can use standard tools to parse these log files. However, unlike W3C log files, HTTP API log files do not contain the columns names.
 * Types of errors that the HTTP API logs

The HTTP API logs a variety of common errors.



Configure HTTP API error logging
Three registry values under an HTTP \Parameters key control the HTTP API error logging. These keys are located at the following registry key:

Note The location and the form of the configuration values may change in later versions of the Microsoft Windows operating system.

You must have Administrator/Local System credentials to change the registry values, and to view or modify the log files and the folder that contains them.

Configuration information in the registry values is read when the HTTP API driver starts. Therefore, if you change the settings, you must stop, and then restart the driver to read the new values. To do this, type the following console commands:

net stop http

net start http

The following naming convention is used to name the log files:

httperr +  + .log

Example: httperr4.log

Log files are cycled when they reach the maximum size that the ErrorLogFileTruncateSize registry value specifies. This value cannot be less than one megabyte (MB).

If the configuration of error logging is not valid, or if any type of failure occurs while the HTTP API is writing to the log files, the HTTP API uses event logging to notify administrators that error logging is not occurring.

The following table describes the registry configuration values.

back to the top

Format of the HTTP API error logs
Generally, HTTP API error log files have the same format as W3C error logs, except that HTTP API error log files do not contain column headings. Each line of an HTTP API error log records one error. The fields appear in a specific order. A single space character (0x0020) separates each field from the previous field. In each field, plus signs (0x002B) replace space characters, tabs, and nonprintable control characters.

The following table identifies the fields and the order of the fields in an error log record.

The following sample lines are from an HTTP API error log:

2002-07-05 18:45:09 172.31.77.6 2094 172.31.77.6 80 HTTP/1.1 GET /qos/1kbfile.txt 503 – ConnLimit 2002-07-05 19:51:59 127.0.0.1 2780 127.0.0.1 80 HTTP/1.1 GET /ThisIsMyUrl.htm 400 – Hostname 2002-07-05 19:53:00 127.0.0.1 2894 127.0.0.1 80 HTTP/2.0 GET / 505 - Version_N/S 2002-07-05 20:06:01 172.31.77.6 64388 127.0.0.1 80 - - - - - Timer_MinBytesPerSecond

back to the top

Types of errors that the HTTP API logs
The HTTP API logs error responses to clients, connection time-outs, orphaned requests, and dropped connections that are handled incorrectly.

The following list identifies the types of errors that the HTTP API logs:
 * Responses to clients The HTTP API sends an error response to a client, for example, a 400 error that is caused by a parse error in the last received request. After the HTTP API sends the error response, it terminates the connection.
 * Connection time-outs The HTTP API times out a connection. If a request is pending when the connection times out, the request is used to provide more information about the connection in the error log.
 * Orphaned requests A user-mode process quits unexpectedly while there are still queued requests that are routed to that process. The HTTP API logs the orphaned requests in the error log.

Specific error types are designated by Reason Phrase strings that always appear as the last field of each error line. The following table identifies the HTTP API Reason Phrases.

back to the top

Keywords: kbhttphandlers kbhttp kbapi kberrmsg kbinfo KB820729

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.