Hit Logging API

Hit Logging API


The Channel Definition Format (CDF) files allow content providers to determine which hits get logged for the items included in the CDF file. These logs are posted to the server during a scheduled update and cleared. This API allows developers to verify if hit logging is enabled and write customized entries in the log.

To use these functions, make sure the Urlmon.h header file is in the include directory, and the Urlmon.lib library file is in the library directory of the C/C++ compiler you use.

arrowy.gifAbout Logging

arrowy.gifFunctions

arrowy.gifStructures

About Logging

The logs that are created contain the URL of the resource, the browsing context, whether the information was viewed from the cache, date viewed, time that the viewing started, duration it was viewed, and the custom information. Only the browsing context (normal browser window, theater view, Active Desktop Item, or Microsoft Internet Exporer screen saver) cannot be set by the WriteHitLogging function.

For more information about logging, see the Page-Hit Logging and Client-Side Logging sections in the Creating Active Channels documentation.

Functions

The following section contains the functions used for hit logging.

IsLoggingEnabled

BOOL IsLoggingEnabled
    IN LPCTSTR pszUrl
);

Determines if hit logging is enabled for the specified Internet site.

pszUrl
String value containing the URL of the resource to check.

WriteHitLogging

BOOL WriteHitLogging(
    IN LPHIT_LOGGING_INFO lpLogginginfo
);

Writes an entry into the log for the given resource.

lpLogginginfo
Address of the HIT_LOGGING_INFO structure that contains the information to add to the log.

Structures

The following section contains the structure used for hit logging.

HIT_LOGGING_INFO

typedef struct _HIT_LOGGING_INFO (
    DWORD dwStructSize;
    LPSTR lpszLoggedUrlName;
    SYSTEMTIME StartTime;
    SYSTEMTIME EndTime;
    LPSTR lpszExtendedInfo
) HIT_LOGGING_INFO, *LPHIT_LOGGING_INFO;

Contains the information to write into a hit log.

dwStructSize
Unsigned long integer value that contains the size, in bytes, of this structure.
lpszLoggedUrlName
String value that contains the name of the cache entry. The name string should not contain any escape characters.
StartTime
SYSTEMTIME value that contains the time to start logging for this URL.
EndTime
SYSTEMTIME value that contains the time to stop logging for this URL. This time is used to determine the duration that the user viewed the resource.
lpszExtendedInfo
String value containing custom information.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.