centralW3CLogFile Element for log [IIS Settings Schema]

Note

For more information about the centralW3CLogFile element, see the following topic on the Microsoft IIS.net Web site: Central W3C Log File <centralW3CLogFile>.

Specifies the central W3C log settings for all sites on a server.

Syntax

Attributes and Elements

The following sections describe attributes, child elements, and parent elements for this section.

Attributes

Attribute

Description

directory

Optional string attribute.

Specifies the directory where log entries are written.

The default value is "%SystemDrive%\inetpub\logs\LogFiles".

enabled

Optional Boolean attribute.

Specifies whether central W3C logging is enabled.

The default value is true.

localTimeRollover

Optional Boolean attribute.

Specifies whether a new log file is created based on local time or Coordinated Universal Time (UTC).

Note

A value of true means the new log file is based on local time; false means it is based on UTC.

The default value is talse.

logExtFileFlags

Optional enum attribute.

Specifies which fields to log.

The logExtFileFlags attribute can be one of the following values or a list of these values. The default is a list of these values: Date, Time, ClientIP, UserName, SiteName, ServerIP, Method, UriStem, UriQuery, HttpStatus, Win32Status, ServerPort, UserAgent, HttpSubStatus.

ValueDescription
Date The date on which the activity occurred. The numeric value is 1.
Time The time, in Coordinated Universal Time (UTC), at which the activity occurred. The numeric value is 2.
ClientIP The IP address of the client that made the request. The numeric value is 4.
UserName The name of the authenticated user who accessed your server. Anonymous users are indicated by a hyphen. The numeric value is 8.
SiteName The name of the server on which the log file entry was generated. The numeric value is 16.
ComputerName The name of the computer from which the request was made. The numeric value is 32.
ServerIP The IP address of the server on which the log file entry was generated. The numeric value is 64.
Method The requested action, for example, a GET method. The numeric value is 128.
UriStem The target of the action, for example, Default.htm. The numeric value is 256.
UriQuery The query, if any, that the client was trying to perform. A Universal Resource Identifier (URI) query is necessary only for dynamic pages. The numeric value is 512.
HttpStatus The HTTP status code. The numeric value is 1024.
Win32Status The Windows status code. The numeric value is 2048.
BytesSent The number of bytes that the server sent. The numeric value is 4096.
BytesRecv The number of bytes that the server received. The numeric value is 8192.
TimeTaken The time that the action took, in milliseconds. The numeric value is 16384.
ServerPort The server port number that is configured for the service. The numeric value is 32768.
UserAgent The browser type that the client used. The numeric value is 65536.
Cookie The content of the cookie sent or received, if a cookie was sent or received. The numeric value is 131072.
Referer The site that the user last visited. This site provided a link to the current site. The numeric value is 262144.
ProtocolVersion The protocol version that the client used. The numeric value is 524288.
Host The host header name, if there is a host header. The numeric value is 1048576.
HttpSubStatus The substatus error code. The numeric value is 2097152.

period

Optional enum attribute.

Specifies how frequently the current log file is closed and a new log file is started.

The period attribute can be one of the following possible values. The default is false.

ValueDescription
MaxSize Log files are cleared whenever the log file reaches the size specified by the truncateSize attribute. The numeric value is 0.
Daily Log files are cleared every day. The numeric value is 1.
Weekly Log files are cleared once a week. The numeric value is 2.
Monthly Log files are cleared once a month. The numeric value is 3.
Hourly Log files are cleared every hour. The numeric value is 4.

truncateSize

Optional int attribute.

Specifies the size, in bytes, at which the log file contents will be truncated. This attribute must be set when the value of the period attribute is maxSize. The size must be between 1048576 (1 megabyte) and 4294967295 (4 gigabytes).

The default value is 20971520 (20 megabytes).

Child Elements

None.

Parent Elements

Element

Description

configuration

Specifies the root element in every configuration file that is used by IIS 7.

system.applicationHost

Specifies the root element for configuring Web process settings.

log

Specifies the logging mode for a server.

Remarks

For more information about the centralW3CLogFile element, see the following topic on the Microsoft IIS.net Web site: Central W3C Log File <centralW3CLogFile>.

Element Information

Configuration locations

Machine.config

ApplicationHost.config

Root application Web.config

Application Web.config

Directory Web.config

Requirements

Microsoft Internet Information Services (IIS) version 7.0

See Also

Reference

centralBinaryLogFile Element for log [IIS Settings Schema]