Logging

No web server would be complete without detailed logging of every hit to the server. This includes not just page requests but images, files, HEAD requests, and virtually every request made to the web server. IIS has always had logging, and IIS 8.0 is no exception.

The default location for the log files is %SystemDrive%\inetpub\logs\LogFiles. By default, each website has its own set of logs, but this can be changed so that logging is per server.

Note
The per-site logs are placed in their own folder, which is named by the site ID. Therefore, by default, a site with a site ID of 10 would have its log files saved to %SystemDrive%\inetpub\logs\LogFiles\w3svc10\.

The log settings can be changed in IIS Manager at the server, site, application, or file level. However, not all settings are applicable at all levels. For example, the server level is the only place where you can set the encoding type and whether logging is per site or per server.

To change the log settings, double-click the Logging icon in IIS Manager. Most settings are set in the main Logging pane, but enabling and disabling logging is set in the Actions pane on the right.

Note
Beside the Format dropdown list is a Select Fields button. This allows you to specify which fields are logged to disk. Three fields that aren't enabled by default that we recommend enabling are Bytes Sent, Bytes Received, and Cookie. (Time Taken is another good setting to watch; it is default in IIS 8.0.) These fields will be read ...

Get Professional Microsoft IIS 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.