ODBC Logging

Applies To: Windows Server 2003, Windows Server 2003 with SP1

ODBC logging records a fixed set of data fields in an ODBC-compliant database, such as Microsoft® Access or Microsoft® SQL Server™. With ODBC logging, you must set up a database to receive the data, and then specify this database as the database to which log files should be recorded.

When ODBC logging is enabled, IIS disables the HTTP.sys kernel-mode cache. For this reason, implementing ODBC logging will degrade overall server performance. ODBC logging is not recommended unless your database limits you to this option.

IIS includes a Structured Query Language (SQL) template file that you can run in a SQL database to create a table that accepts log file entries from IIS. The file is named Logtemp.sql, and it is located in the systemroot\System32\Inetsrv directory by default.

Important

For security reasons, do not use the well-known SQL Server administrator account name SA for ODBC logging. If a malicious user accessed the worker process, that user could use the SA account to access the SQL Server. Remove the SA account, and create a new account with the least necessary rights. For more information, see SQL Server 2000 Operations Guide: Security Administration.

Table 10.7 lists the fields, data types, and descriptions of the fields recorded in the ODBC logging format.

Table 10.7 ODBC Logging Fields

Field Data Type Description

ClientHost

varchar(255)

The IP address of the client.

UserName

varchar(255)

The domain name of the client.

LogTime

datetime

The connection date and time.

Service

varchar(255)

The IIS service.

Machine

varchar(255)

The name of the computer.

ServerIP

varchar(50)

The IP address of the server.

ProcessingTime

integer

The processing time, in milliseconds.

BytesRecvd

integer

The number of bytes that the server received.

BytesSent

integer

The number of bytes that the server sent.

ServiceStatus

integer

The service status or reply code. A value of 200 indicates that the request was fulfilled successfully.

Win32Status

integer

The Windows status or error code. A value of 0 indicates that the request was fulfilled successfully.

Operation

varchar(255)

The command that the user requested.

Target

varchar(255)

The recipient.

Parameters

varchar(255)

The request parameters that the client sent.