IWMSLoggingAdmin Interface

banner art

Previous Next

IWMSLoggingAdmin Interface

The IWMSLoggingAdmin interface is exposed by the WMS Client Logging plug-in, an event plug-in that listens for a log event and saves information gathered from that event to a log file. The logging plug-in can be installed in the namespace of both the server and a specific publishing point. Instances of the plug-in at the server level receive all notifications on all requested events. Instances of the plug-in at the publishing point level receive only events that are related to the specific publishing point.

In addition to the methods inherited from IDispatch, the IWMSLoggingAdmin interface exposes the following methods.

Method Description
CycleNow Forces a log file cycle.
ExpandTemplate Retrieves the expanded path of a template.
Flush Flushes the buffer to the log file.
get_CurrentLogFileName Retrieves the name of the current log file.
get_Cycle Retrieves an enumeration value indicating how often the log file cycles.
get_Dirty Retrieves a Boolean value that indicates whether the currently running configuration is different from the stored configuration.
get_FreeSpaceQuota Retrieves the minimum percentage of disk space that must remain available after data has been written to a log file.
get_LoggedEvents Retrieves an enumeration value indicating the types of transmissions for which events are logged.
get_MaxSize Retrieves the maximum permitted size of a log file.
get_RoleFilter Retrieves a filter value for logging events with a specific role attribute.
get_Template Retrieves the log file template path.
get_UseBuffering Retrieves a Boolean value that indicates whether logging data is buffered before it is flushed to the log file.
get_UseLocalTime Retrieves a Boolean value indicating whether times in the log file are recorded in local time.
get_UseUnicode Retrieves a Boolean value indicating whether the log file contains Unicode or ANSI text.
get_V4Compat Retrieves a Boolean value indicating whether log files are created in a format that is compatible with previous versions of Windows Media Services.
IsPathValid Validates the path to the log file.
put_Cycle Specifies an enumeration value indicating how often the log file cycles.
put_FreeSpaceQuota Specifies the minimum percentage of disk space that must remain available after data has been written to a log file.
put_LoggedEvents Specifies an enumeration value indicating the types of transmissions for which events are logged.
put_MaxSize Specifies the maximum permitted size of a log file.
put_RoleFilter Specifies a filter value for logging events with a specific role attribute.
put_Template Specifies the log file template path.
put_UseBuffering Specifies a Boolean value that indicates whether logging data is buffered before it is flushed to the log file.
put_UseLocalTime Specifies a Boolean value indicating whether times in the log file are recorded in local time.
put_UseUnicode Specifies a Boolean value indicating whether the log file contains Unicode or ANSI text.
put_V4Compat Specifies a Boolean value indicating whether log files are created in a format that is compatible with previous versions of Windows Media Services.

Example Code

The following example illustrates how to retrieve a pointer to an IWMSLoggingAdmin interface.

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.

// To access system plug-in interfaces, the
// entire type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interfaces.
IWMSServer          *pServer;
IWMSPlugins         *pPlugins;
IWMSPlugin          *pPlugin;
IDispatch           *pDispatch;
IWMSLoggingAdmin    *pLogAdmin;

HRESULT         hr;
CComVariant     varIndex;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlugins interface
// containing event handler plug-ins.
hr = pServer->get_EventHandlers(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface
// of the plug-in to be configured.
varIndex = "WMS Client Logging";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the custom interface
// of the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Query the specific administration interface
// for the plug-in.
hr = pDispatch->QueryInterface(IID_IWMSLoggingAdmin,
                              (void **)&pLogAdmin);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Previous Next