Custom Process Logging for Debugging Scripts

The logging framework can be used for debugging runtime problems with custom process scripts during development and testing.

Two entities are used in custom process logging:

  • Terminals—Provide the logging function. You define terminals in PHP scripts that you import to the process designer. The Terminal class is provided with Connect Common Object Model (CCOM) version 1.3 and later.
  • Probes—Control which terminals are used for logging. You create probes on the Agent Browser UI using the probe designer.
Note: The probe designer currently works only on the Agent Browser UI. However, you create the custom process models for logging in the Service Console.

Probes control which terminals are activated based on these fields:

  • Terminal Name
  • Log Level

When a probe is enabled, it activates all terminals whose:

  • Terminal name matches the name, wildcard, or regular expression provided in the probe. Terminal names are defined in the custom process model script.
  • Log level is as severe as, or more severe than, the log level provided in the probe.

You use these rules for writing regular expressions in the Terminal Name field:

Regular Expressions for Terminal Names in Probes

Expression Indicates
+ One or more of the previous character
* Zero or more of the previous character
. Any character
\w Any word character (alphanumeric or underscore). Only matches standard ASCII characters (no accented or non-Latin characters).

This expression is equivalent to [A-Z a-z 0-9 _ ].

For example:

  • ter+ will match ter and terr, but not te or term
  • ter* will match te, ter, and terr, but not term
  • term.* will match term, term1, and termm

Probes have these log levels, which are listed in order of decreasing severity:

Log Levels for Probes

ID Name
1 FATAL
2 ALERT
3 CRITICAL
4 ERROR
5 WARN
6 TRACE
7 INFO
8 DBG

You must perform these tasks to implement custom process logging:

  1. Define the Terminals in the Custom Process Script.
  2. Create the Object Event Handler.
  3. Create Probes for Logging.

After creating the probes, you perform operations to test your custom processes, then examine the custom process logs.