====== LOG_EVENT method ====== ==== Description ==== The LOG_EVENT method allows you to write a message to the Windows Event Log without the need for you to prototype and use any Windows API functions yourself. It is very easy to use and takes three arguments: 1) Type Info: This is a dynamic array comprised of the following fields: <1> Message Type (Required) : "ERROR", "WARNING" or "INFO". <2> Event ID (Optional) : Integer denoting the event. Defaults to 1. <3> Category ID (Optional) : Integer identifying the category. defaults to 0. 2) Source Info: This is a dynamic array comprised of the following fields: <1> Event Source (Required) : Name of the EVENT Source. <2> UNC Name of the system to post the message to. Defaults to the local workstation. 3) Message Text: This is simply the text of the message to post to the Event Log. Example: Post an error message to the Event Log from the "RevPS" Event Source: x = exec_Method( "SYSTEM", "LOG_EVENT", "ERROR", "RevPS", "FOOBAR!!!!" ) === The Event Source name === If you simply execute the above code you will see the message you posted in the Application Event Log, but you will also see that Windows has prefixed your message with some of its own text which refers to a missing Event ID description. The reason for this is that Windows expects to find a "registered Event Source" containing a set of strings, each of which corresponds to an Event ID. without this DLL you get warning text that does not look professional and gives the impression that something is missing from your application. For OpenInsight 10 we have provided a generic DLL called RevEventMsg.dll that you can register on your system under your desired Event Source name - if you then use that name in your call to the LOG_EVENT method you will see your message without any of the warning text prefixed to it. Registering the DLL is quite a new key with the name of your Event Source (we used the string "RevPS" for this example) under this path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\ and set the following values: EventMessageFile REG_SZ C:\Revsoft\RevX\RevEventMsg.dll TypesSupported REG_DWORD 0x0000001f (31) ==== Applies To ==== SYSTEM object