Article ID: 245243 - Last Review: July 7, 2008 - Revision: 6.1 How to configure ODBC logging in IISThis article was previously published under Q245243 We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 7.0 running on Microsoft Windows Server 2008. IIS 7.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site: http://www.microsoft.com/technet/security/prodtech/IIS.mspx
(http://www.microsoft.com/technet/security/prodtech/IIS.mspx)
For more information about IIS 7.0, visit the following Microsoft Web site: http://www.iis.net/default.aspx?tabid=1
(http://www.iis.net/default.aspx?tabid=1)
On This PageSUMMARY
In Internet Information Server (IIS) 4.0, in Internet Information Services (IIS) 5.0, and in Internet Information Services (IIS) 6.0, you can configure the Open Database Connectivity (ODBC) logging feature to allow logging to local Microsoft Access databases or local or remote Microsoft SQL Server databases. Create a TableCreate a table in the Microsoft Access or SQL Server database. To do this, either follow the steps in the Run a SQL Script to Automate Creating the Table section, or create a table manually by using the fields in the Table - Field Format section. The default table name is InternetLog on the ODBC Logging Properties page in the Internet Services Manager (ISM) Microsoft Management Console (MMC).NOTE: These steps work for World Wide Web (WWW) or File Transfer Protocol (FTP) logging on the Web server. Run a SQL Script to Automate Creating the TableIf you are using a computer that is running SQL Server, you can create the IIS ODBC logging table with a Transact-SQL script named Logtemp.sql that is included with IIS. To do this, follow these steps:
Table - Field FormatFieldName: ClientHostData Source/Type: Varchar(255) Explanations: Client IP address. FieldName: Username Data Source/Type: Varchar(255) Explanations: User name for the client. If the page is not password-protected, this is always the anonymous user name. FieldName: LogTime Data Source/Type: Datetime Explanations: Date and time that the log entry was created. FieldName: Service Data Source/Type: Varchar(255) Explanations: Name of the service. This can be WWW, FTP, or some other name. FieldName: Machine Data Source/Type: Varchar(255) Explanations: Server name. FieldName: ServerIP Data Source/Type: Varchar(255) Explanations: Server IP address. FieldName: ProcessingTime Data Source/Type: Int Explanations: Time spent on request processing (in milliseconds). FieldName: BytesRecvd Data Source/Type: Int Explanations: Number of bytes received. FieldName: BytesSent Data Source/Type: Int Explanations: Number of bytes sent. FieldName: ServiceStatus Data Source/Type: Int Explanations: Service status, such as 200. FieldName: Win32Status Data Source/Type: Long Integer Explanations: Windows NT status code. 0 typically indicates success. FieldName: Operation Data Source/Type: Varchar(255) Explanations: Type of the operation or command. For example, this may be USER for FTP or GET for WWW. FieldName: Target Data Source/Type: Varchar(255) Explanations: Target of the operation. For example, this may be Default.htm. FieldName: Parameters Data Source/Type: Varchar(255) Explanations: Any parameters for the operation. This can be either name/value pairs for invoking CGI or an ISAPI extension. It is a user name for the FTP command USER. Create a System DSNNOTE: This example uses SQL Server 7.0.
Configure IIS for ODBC Logging
Recommendations for ODBC Logging
TroubleshootingIf the InternetLog table is not configured correctly, or if the correct user has not been granted the right permissions to the InternetLog table, you may receive either Event ID 5, Event ID 6 (with a source of IISLOG), or both in the system log of the Event Viewer.NOTE: For other database systems, you must configure a system DSN to link the database and table that contain the appropriate fields for the logging format, and then follow the steps in Configuring IIS for ODBC Logging to set up logging. REFERENCES
For more information about ODBC logging issues, click the following article numbers to view the articles in the Microsoft Knowledge Base:
149398
(http://support.microsoft.com/kb/149398/
)
IIS logging to SQL Server fails with blank username and password
192293
(http://support.microsoft.com/kb/192293/
)
IIS stops ODBC logging after failing to communicate with SQL Server
256839
(http://support.microsoft.com/kb/256839/
)
Long URL requests or parameters are not logged when you use ODBC logging
For more information about importing IIS logs to SQL, click the following article numbers to view the articles in the Microsoft Knowledge Base:
296085
(http://support.microsoft.com/kb/296085/
)
How to use SQL Server to analyze Web logs
296093
(http://support.microsoft.com/kb/296093/
)
PrepWebLog utility prepares IIS logs for SQL bulk insert
| Article Translations
|
Back to the top
