Enabling Logging

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

You can choose a format and enable logging for individual Web sites and FTP sites. After you enable logging on a Web site or FTP site, all traffic to the site (including virtual directories) is written to the corresponding file for each site.

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

Procedures

To enable logging on a Web or FTP site

  1. In IIS Manager, double-click the local computer, double-click the Web Sites or FTP Sites folder, right-click the Web site or FTP site for which you want to enable logging, and then click Properties.

  2. On the Web Site or FTP Site tab, select the Enable logging check box.

  3. In the Active log format box, click a format. By default, the format is W3C Extended Log File Format.

    Note

    If you select ODBC logging, click Properties and type the ODBC Data Source Name (DSN) and the name of the table within the database in the text boxes. If a user name and password are required to access the database, type the necessary credentials, and then click OK.

    Note

    Logging to a UNC share is not supported by IIS FTP. You must configure the FTP log files location to a path on the local machine.

  4. Click Apply, and then click OK.

  • For more information about logging, including examples and descriptions of various IIS log file formats and information about HTTP.sys error logging, see the Analyzing Log Files section.

  • For an explanation of W3C Extended logging fields, including a detailed technical breakdown of the time-taken field, see W3C Extended Log File Format.