Previous in Contents Next in Contents

TrafficLogFile.InitTraffic Method

Note  The TrafficLogFile object is included in Commerce Server 3.0 only for backward compatibility with sites created in Commerce Server 2.0. New sites should measure traffic with Site Server Analysis.

The InitTraffic method initializes the TrafficLogfile object by identifying the kinds of information to log and the location of the log file.

Syntax

TrafficLogfile.InitTraffic(SiteName, FileName, Arguments)

Parameters

SiteName
An arbitrary string that will be included with each log, usually used to identify the site in the log. This string will be logged only if the store_name keyword is included in the Arguments list. (If you do not want to log this string, specify a string with a single blank.)
FileName
The local path to the file where events and data will be logged.
Arguments
Optional. A list of keywords that identify the information you want to log.

The following table lists the keywords that might be listed when calling the InitTraffic method, along with the type of information each keyword causes to be logged.
Keyword Information to be logged
store_name Enables the LogTraffic method to log the text that was provided to InitTraffic as its SiteName argument. Usually this string contains the name of the site.
shopper_id Enables the LogTraffic method to log the unique identifier of the current shopper, which is provided as its ShopperID argument.
event Enables the LogTraffic method to log the number provided as its Event argument. This arbitrary number is usually used to identify the type of event being logged.
item_requested Enables the LogTraffic method to log the string provided as its ItemRequested argument. This arbitrary string is usually used to identify the URL of the page being requested.
event_time Enables the LogTraffic method to include the current time in the log record.
args_argname Enables the LogTraffic method to log the value of a specified URL query string passed to the page in the URL (either from a FORM or a generated URL). argname must match the name of the variable in a query string. For example, if the keyword args_product is listed, then LogTraffic will look for a query string in the URL beginning "?product=" and will include the value specified in the log.
remote_addr Enables the LogTraffic method to log the IP address of the client computer.
remote_host Enables the LogTraffic method to log the host name of the client computer (in some cases, this value may be an IP address).
http_argname Enables the LogTraffic method to log environment variables, such as REFERER and USER_AGENT (for example, http_REFERER). In names containing hyphens, an underscore is used instead of a hyphen because database column names cannot contain hyphens.

Example

The following example creates and initializes a database traffic server to log the site name (Clocktower) and shopper ID to the specified file:

Set  MSCSTraffic = Server.CreateObject("Commerce.TrafficLogfile")
call MSCSTraffic.InitTraffic("Clocktower", "c:\\Clocktower_traffic.log", "store_name", "shopper_id")

© 1997-2000 Microsoft Corporation. All rights reserved.