IIS administrators often monitor IIS log files manually or programmatically, watching for server errors or suspicious client activity. The log files that are created by the IIS logging modules are easy to read manually, however the following methods can be used to monitor IIS log files programmatically.
The LogParser Tool
Log Parser 2.0 is a powerful, versatile tool that makes it possible to run SQL-like queries against log files of almost any format and produce the desired information either on the screen, in a file of any desired format or into a SQL database. Log Parser is available as a command-line tool and as a set of scriptable COM objects. LogParser can be downloaded from the Microsoft Download Center.
Displaying Data in ASP Pages
The ODBC logging module for IIS allows you to log to a database. With ASP, you can use ActiveX Data Objects (ADO) to display and manipulate data from the logging database. For more information, see Accessing Databases in IIS Applications.
Displaying Log Data in ASP.NET Pages
The ODBC logging module for IIS allows you to log to a database. With ASP.NET, you can use ADO.NET to display and manipulate data from supported data sources such as a database.
Use data source controls such as SqlDataSource, AccessDataSource, ObjectDataSource, or a custom control to connect to your data source. Then, to display your data in a formatted, customizable manner, bind the data to a server control such as the GridView, DataGrid, or Table control.
For more information, see Data Access in ASP.NET 2.0, Accessing Data with ADO.NET, or Displaying Database Information Using a Table Web Server Control.
The Logging Utility Component
The IIS logging component, %SystemRoot%\system32\inetsrv\Logscrpt.dll, implements the ILogScripting COM Interface interface, which enables your applications to read from the IIS log. This component allows you to quickly create, for example, ASP scripts or VB components that programmatically walk through daily log files so that certain types of information can be extracted.
The IIS logging component is deprecated. IIS 6.0 will be the last version that supports this component.