Configure Per-Site Logging Options at the Server Level (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
Configure per-site logging options at the server level when you want logging settings to apply to all sites on your server by default. You can then open the Logging page at the site level to configure specific settings for a site.
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
To configure per-site logging options at the server level
You can perform this procedure by using the user interface (UI), or by editing configuration files directly.
To use the UI
Open IIS Manager and navigate to the level 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).
In Features View, double-click Logging.
On the Logging page, under One log file per site, select Site from the drop-down list. By default, Site is selected.
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).
Under Directory, specify the path where the log file should be stored. The default is %SystemDrive%\inetpub\logs\LogFiles
As a best practice, log files, such as failed request tracing logs, should be stored in a directory other than systemroot.
Under Encoding, select one of the following options from the drop-down list:
UTF-8: to enable both single-byte and multibyte characters in one string.
ANSI: to enable only single-byte characters in one string.
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.
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.
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.
- Click Apply in the Actions pane.
The procedure in this topic affects the following configuration elements:
For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.