MessageLog2 Interface




MessageLog2 is an interface supported by MessageLog collections in PI-SDK 1.3.6 and later releases. It contains all methods and properties of MessageLog, as well as these additional methods and properties that support sending and retrieving more complex messages with additional contextual properties.

The MessageLog object provides access to the error message logging facilities on the local PI-SDK node as well as remote PI nodes. Methods are provided to send messages to be logged and to retrieve messages already logged.  The MessageLog2 interface adds support for standard messages based on message templates identified by an ID.  Using ID based messages adds consistency to the logs across applications and reduces the amount of data that needs to be stored and passed during logging activities. In addition, the interface provides a mechanism to log additional message parameters (for example category or priority) with any message.  Providing additional message parameters aids in the categorization, triage, and resolution of problems identified by log messages.


The local message logging system is accessed from the MessageLog property of the global PISDK object. A specific server’s log (remote, or local if a server exists on the PI-SDK node) can be accessed from the Server object’s MessageLog propery. In cases where a PI-SDK program is running on a PI server node directly, a single instance of the underlying logging service supports both objects. In this case messages from client applications and the server will be intermingled in the log.

If the PI message logging service is unavailable on a node, messages are sent to the Windows Application Event Log.

Enabling Operational Intelligence