The CreatorCon Call for Content is officially open! Get started here.

How can I view gs.log and gs.print statements using Debug log?

warrenjones_ser
Kilo Contributor

Hi community,

I've read the wiki on Debugging Tools Best Practices - ServiceNow Wiki and I always like to try out what I'm reading.

In my attempt to view the log statements after I clicked the Debug Log module, is <<<[0.00.00.003] Script completed in scope global: Debug Log>> in the context pane.

How can I view these log statements? And while on the subject, how can I view message displays as well for the Debug Business Rules. Clicking on the module gives me the same result as above.

Thanks guys

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Warren,



I should be able to help. I wrote that wiki page a few years ago. 🙂



Simply clicking the modules turns the debugging capability on. You have to do something (like update a record, run a script with a gs.print/gs.log statement in it, etc.)



After clicking the modules, you'll see output at the bottom of your forms and lists indicating the output statements. Business rules will do the same prefixed with either "==>" indicating the BR started/entered, "<==", exited, or "===" skipped.



Sample output while debug business rule is enabled...


find_real_file.png


View solution in original post

3 REPLIES 3

Chuck Tomasi
Tera Patron

Hi Warren,



I should be able to help. I wrote that wiki page a few years ago. 🙂



Simply clicking the modules turns the debugging capability on. You have to do something (like update a record, run a script with a gs.print/gs.log statement in it, etc.)



After clicking the modules, you'll see output at the bottom of your forms and lists indicating the output statements. Business rules will do the same prefixed with either "==>" indicating the BR started/entered, "<==", exited, or "===" skipped.



Sample output while debug business rule is enabled...


find_real_file.png


Chuck Tomasi
Tera Patron

Here's some output from the business rule incident query while running as Joe Employee.



find_real_file.png



The nice thing about debugging business rules, debug logs, ACLs, etc. is that it remains on while you impersonate another user - very handy for diagnostics.



This might also help Debugging Tools Best Practices - ServiceNow Wiki


Thanks ctomasi, it always seems like it's the little stuff that trip you up.