Debugging triggers

triggers

#1

I recently had to create a multiple tier trigger that spanned multiple events as well as protocols. For any one that has had to deal with this problem, you all know that soon enough you get to a point where you wish you could see how the triggers were executing in real time (aka debugging triggers). The most obvious way to solve this is to use the runtime logs. While this is a reasonable solution, it is not as useful if you have multiple triggers as the logs are separate for each trigger.

I solved this using our new RSyslog and a netcat running on my laptop to receive the syslog messages. If you think about it the RSyslog triggers are just a way to send syslog formated messages to the remote system listening on any port. The listener on the remote machine can be syslog or some thing much simpler like a netcat that is dumping the data to the console.

Using this functionality I was able to not only time stamp the order in which the triggers executed but now I had a single console that showed all the messages generated by separate triggers.

for each (var a in DB.params) {
   if (a.name && a.name.toLowerCase() == "@requestguid") {
     Flow.store.corid = a.value;
     RemoteSyslog.info("Correlation ID found -  " + a.value);
   }
}

Until next time, happy debugging.

Major