Share via

Select W3C Fields to Log (IIS 7)

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

Select W3C fields to log when you want to control the amount of data that is stored in the log file.


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 select W3C fields to log

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 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).

  2. In Features View, double-click Logging.

  3. On the Logging page, in the Log file section under Format, click Select Fields.

  4. In the W3C Logging Fields dialog box, select one or more of the following options:

    • Date (date): the date on which the request occurred.

    • Time (time): the time, in Coordinated Universal Time (UTC), at which the request occurred.

    • Client IP Address (c-ip): the IP address of the client that made the request.

    • User Name (cs-username): the name of the authenticated user who accessed your server. Anonymous users are indicated by a hyphen.

    • Service Name (s-sitename): the site instance number that fulfilled the request.

    • Server Name (s-computername): the name of the server on which the log file entry was generated.

    • Server IP Address (s-ip): the IP address of the server on which the log file entry was generated.

    • Server Port (s-port): the server port number that is configured for the service.

    • Method (cs-method): the requested action, for example, a GET method.

    • URI Stem (cs-uri-stem): the Universal Resource Identifier, or target, of the action.

    • URI Query (cs-uri-query): the query, if any, that the client was trying to perform. A Universal Resource Identifier (URI) query is necessary only for dynamic pages.

    • Protocol Status (sc-status): the HTTP or FTP status code.

    • Protocol Sub-status (sc-substatus): the HTTP or FTP substatus code.

    • Win32 Status (sc-win32-status): the Windows status code.

    • Bytes Sent (sc-bytes): the number of bytes that the server sent.

    • Bytes Received (cs-bytes): the number of bytes that the server received.

    • Time Taken (time-taken): the length of time that the action took in milliseconds.

    • Protocol Version (cs-version): the protocol version, HTTP or FTP, that the client used.

    • Host (cs-host): the host name, if any.

    • User Agent (cs(UserAgent)): the browser type that the client used.

    • Cookie (cs(Cookie)): the content of the cookie sent or received, if any.

    • Referer (cs(Referer)): the site that the user last visited. This site provided a link to the current site.

  5. 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.

See Also


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