IWMSEventLog.LogEvent (C#)
Previous | Next |
IWMSEventLog.LogEvent (C#)
The LogEvent method sends an event to the Windows Event Viewer.
Syntax
void
Parameters
pPluginNamedValues
[in] IWMSNamedValues object passed by the server to the plug-in when it calls the IWMSBasicPlugin.InitializePlugin method. The plug-in does not need to use the object.
ErrorLevel
[in] Member of the WMS_EVENT_LOG_LEVEL enumeration type. This must be 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. |
lErrorCode
[in] int containing the error code associated with the event. If the plug-in is sending an information or warning event, specify 0.
bstrAdditionalInfo
[in] string containing additional information about the event.
Return Values
This method does not return a value.
Example Code
public void InitializePlugin(IWMSContext pServerContext, WMSNamedValues pNamedValues, IWMSClassObject pClassFactory) { try { m_ClassFactory = pClassFactory; m_NamedValues = pNamedValues; Guid EventLogGuid = typeof(IWMSEventLog).GUID; object EventLogObject = (object)m_EventLog; pServerContext.GetAndQueryIUnknownValue( WMSDefines.WMS_SERVER_EVENT_LOG, WMSDefines.WMS_SERVER_EVENT_LOG_ID, ref EventLogGuid, out (object)EventLogObject, 0); m_EventLog = (IWMSEventLog)EventLogObject; m_EventLog.LogEvent(m_NamedValues, WMS_EVENT_LOG_LEVEL.WMS_EVENT_LOG_LEVEL_INFORMATION, 0, "Plug-in initialized."); } catch( Exception e ) { // TODO: Handle exceptions. } }
Requirements
Reference: Add a reference to Microsoft.WindowsMediaServices.
Namespace: Microsoft.WindowsMediaServices.Interop.
Assembly: Microsoft.WindowsMediaServices.dll.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.
See Also
Previous | Next |