IWMSEventLog Interface

The IWMSEventLog interface is implemented by the server. A plug-in can call it to log an event to the Windows Event Viewer. The server can log error, warning, or information events. If either an error or a warning event is sent, the server also adds them to the IWMSDiagnosticEvents collection. The server then queries the collection and adds information about the event to the Troubleshooting tab in the Windows Media Services user interface.

Note

   This interface is available only on Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; and Windows Server 2008.

The plug-in indicates the event type by using a WMS_EVENT_LOG_LEVEL enumeration value containing one of the following values.

Value

Description

WMS_EVENT_LOG_LEVEL_ERROR

Indicates significant problems that the end user must be informed of. Error events usually indicate a loss of functionality or data. For example, if a plug-in fails, it must, if possible, log an error event. The server disables any plug-in that logs an error. Furthermore, if an authentication or authorization plug-in fails, the server will no longer allow new connections or allow clients that are connected to request actions that require authorization.

WMS_EVENT_LOG_LEVEL_WARNING

Indicates problems that are not immediately significant, but that can lead to future problems.

WMS_EVENT_LOG_LEVEL_INFORMATION

Indicates infrequent but significant successful operations.

A plug-in can acquire a pointer to an IWMSEventLog interface from the server context. This is illustrated in the following example.

hrLocal = pIServerContext->GetAndQueryIUnknownValue(
                              WMS_SERVER_EVENT_LOG,
                              WMS_SERVER_EVENT_LOG_ID,
                              IID_IWMSEventLog,
                              ( IUnknown ** ) &pIServerEventLog,
                              0);

The server context is first sent to the plug-in when the server calls IWMSBasicPlugin::InitializePlugin.

In addition to the methods inherited from IUnknown, the IWMSEventLog interface exposes the following method.

Method

Description

LogEvent

Sends an event to the Windows Event Viewer.

See Also

Reference

IWMSDiagnosticEvents Interface

Concepts

Custom Plug-in Interfaces (C++)