Logging diagnostic messages

IDO extension class methods can send messages to the common logging facility IDO Runtime Development Server (IDORuntimeHost.exe) by calling one of the overloaded IDORuntime.LogUserMessage methods.

Example

This sample sends a message to the log each time the ValidateCreditCard method is called:

  • The first parameter is messageSource (String).

    This is the source identifier that displays in the log viewer.

  • The second parameter is messageType (Mongose.IDO.UserDefinedMessageType).

    This is the type identifier that displays in the log viewer.

  • The third parameter is message (String).

    This is the text of the message to be logged.

[IDOMethod(MethodFlags.None, "infobar")] 
public int ValidateCreditCard( 
   string cardNumber, 
   DateTime expires, 
   decimal amount, 
   string infobar) 
{ 

   int result = 0; 

   // Call a Web service to validate the CC info: 
   IDORuntime.LogUserMessage( 
      "MyExtensionClass", 
      UserDefinedMessageType.UserDefined0, 
      "ValidateCreditCard called by user " + IDORuntime.Context.UserName); 

   return result; 
}