IWMSLoggingAdmin Object (C#)

The IWMSLoggingAdmin object 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.

The IWMSLoggingAdmin object exposes the following properties and methods.

Property

Description

CurrentLogFileName

Retrieves the name of the current log file.

Cycle

Retrieves an enumeration value indicating how often the log file cycles.

Dirty

Retrieves a Boolean value indicating whether the currently running configuration is different from the stored configuration.

FreeSpaceQuota

Specifies and retrieves the minimum amount of disk space that must remain after data has been written to a log file.

LoggedEvents

Retrieves an enumeration value indicating the type of transmission for which events are logged.

MaxSize

Retrieves the maximum permitted size of the log file.

RoleFilter

Specifies a filter value for logging events with a specific role attribute.

Template

Retrieves the log file template path.

UseBuffering

Retrieves a Boolean value that indicates whether logging data is buffered before it is flushed to the log file.

UseLocalTime

Specifies a Boolean value indicating whether local times are recorded in the log file.

UseUnicode

Specifies a Boolean value indicating whether the log file contains Unicode or ANSI text.

V4Compat

Specifies a Boolean value indicating whether log files are created in a format compatible with previous versions of Windows Media Services.

Method

Description

CycleNow

Forces a log file cycle.

ExpandTemplate

Retrieves the expanded path of a template.

Flush

Flushes the buffer to the log file.

IsPathValid

Validates the path to the log file.

Example

The following example illustrates how to retrieve an IWMSLoggingAdmin object.

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSLoggingAdmin LogAdmin;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the plug-in to be configured.
    Plugin = Server.EventHandlers[
                        "WMS Client Logging"];

    // Retrieve the custom interface of the plug-in.
    LogAdmin =
        (IWMSLoggingAdmin)Plugin.CustomInterface;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

See Also

Concepts

System Plug-ins (C#)