PutString Method (MessageLog object)

               

 

This method sends a message to the object’s associated message log.

To specify additional message attributes, such as severity, use the MessageLog2.SendLogMessage method.

Syntax

object.PutString Message

The PutString method syntax has these parts:

Part

Description

object

An object expression that evaluates to a MessageLog object.

Message

A string containing the message to be sent to the message log.

Remarks

When messages are sent with this method they are given a message ID of 0 representing an unformatted (not localized) message. The message, when it is received by the logging system, is time stamped using UTC by the system where the message is stored. This means when sending a message from a PI-SDK node to a Server’s MessageLog, if the time clocks differ, the time logged for the message will be the server’s time. This time, when retrieved with a call to MessageLog.List, is retrieved as UTC and converted on the PI-SDK node to local time according to the time zone and DST settings on the PI-SDK machine.

If the message subsystem associated with the object (either the local PI-SDK message subsystem or the destination Server’s message subsystem) is down or not accessible, starting with version 1.3.4.333 messages are written to the Windows Application Event log.  Previously messages were written to the “pipc.log” file in the “dat” subdirectory of the machine’s PIPC directory. A machine's PIPC directory is identified in the pipc.ini file in the Windows directory under the section [PIPC] and the item PIHome or PIPCShare. The PIPCShare item overrides any PIHome setting.

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseLOGMESSAGEPOST

Failed to post the message to the log. See the description for more details.

pseBSTRTOPISTRING

Failed to translate the passed string (BSTR) to an internal PIstring.

pseMSGLOGPARENT

The MessageLog object did not have its parent set correctly internally.

pseMESSAGEUSER

Unable to create an internal message user object.

pseMESSSAGEFILEOPEN

Unable to open the local or server’s message file.

Enabling Operational Intelligence