Log Diagnostic Messages From Your Scripts

When you're developing rules for a business object, you can add a print or println function to custom Groovy code when you want messages logged by your own script to be written to the diagnostic log.

For example, you might have a Before Update trigger script that calls several object functions. You can add the print or println function to your object functions to print a message to the log each time the function is called.

  • If you're using the code editor, you can add a print or println statement. The former writes its value without any newline character, while the latter writes its value along with a newline. For example:
    // Write a diagnostic message to the log
    println("[In: BeforeUpdate] Status = ${Status}")
  • If you are using the Configure Actions window to create and edit triggers, you can drag the Log Message action in the Other Scripting category into your action group to add a println to the action chain.

You can now enable logging to see the functions that were triggered based on the messages, as well as any runtime exceptions. Note that you don't need to do anything special to log trigger starts and trigger ends; these actions are always recorded in the logs.