Configure Logging Options at the Site Level (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

Configure logging options at the site level when you want to set logging settings for a site that differ from those set at the server level.

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Logging Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To configure logging options at the site level

You can perform this procedure by using the user interface (UI), or by editing configuration files directly.

User Interface

To use the UI

  1. Open IIS Manager and navigate to site that you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).

  2. In Features View, double-click Logging.

  3. On the Logging page, in the Log file section under Format, select one of the following log file formats:

    • IIS: to use the Microsoft IIS log file format to log information about a site. This format is handled by HTTP.sys, and is a fixed ASCII text-based format, which means that you cannot customize the fields that are logged. Fields are separated by commas, and time is recorded as local time. For more information about the IIS log file format, see IIS Log File Format (IIS 6.0).

    • NCSA: to use the National Center for Supercomputing Applications (NCSA) Common log file format to log information about a site. This format is handled by HTTP.sys, and is a fixed ASCII text-based format, which means that you cannot customize the fields that are logged. Fields are separated by spaces, and time is recorded as local time with the Coordinated Universal Time (UTC) offset. For more information about the NCSA log file format, see NCSA Common Log File Format (IIS 6.0).

    • W3C: to use the centralized W3C log file format to log information about all sites on the server. This format is handled by HTTP.sys, and is a customizable ASCII text-based format, which means that you specify the fields that are logged. Specify the fields that are logged on the W3C Logging Fields dialog box by clicking Select Fields on the Logging page. Fields are separated by spaces, and time is recorded in Coordinated Universal Time (UTC). For more information about the W3C log file format, see W3C Extended Log File Format (IIS 6.0).

    • Custom: to use a custom format for a custom logging module. When you select this option, the Logging page becomes disabled, because custom logging cannot be configured in IIS Manager. For more information about how to use custom log file formats, see Custom Logging Modules (IIS 6.0).

  4. Under Directory, specify the path where the log file should be stored. The default is %SystemDrive%\inetpub\logs\LogFiles

Note

As a best practice, log files, such as failed request tracing logs, should be stored in a directory other than systemroot.

  1. In the Log File Rollover section, select one of the following options:

    • Schedule: to create new log file that are based on one of the following values:

    • Hourly: a new log file is created each hour.

    • Daily: a new log file is created each day.

    • Weekly: a new log file is created each week.

    • Monthly: a new log file is created each month.

    • Maximum file size (in bytes): to create a new log file when the file reaches a certain size (in bytes).The minimum file size is 1048576 bytes. If this attribute is set to a value less than 1048576 bytes, the default value is implicitly assumed as 1048576 bytes.

    • Do not create a new log file: there is a single log file that will continue to grow as information is logged.

  2. Select Use local time for file naming and rollover to specify that log file naming and time for log file rollover uses the local server time. When this is not selected, Coordinated Universal Time (UTC) is used.

Note

Regardless of this setting, timestamps in the actual log file will use the time format for the log format that you select from the Format list. For example, NCSA and W3C log file formats use UTC time format for timestamps.

  1. Click Apply in the Actions pane.

Configuration

The procedure in this topic affects the following configuration elements:

<logFile>

For more information about IISĀ 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

See Also

Concepts

Configuring Logging in IIS 7 Configure Per-Site Logging Options at the Server Level (IIS 7) Configure Per-Server Logging Options (IIS 7) Select W3C Fields to Log (IIS 7) Configure Log File Rollover Options (IIS 7)