- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 04:00 PM
Hi ServiceNow Community Developers,
If I am using the gs.debug() function in a scoped application where do I go to see the output that was printed out by the function?
For instance, if I use gs.log() in a global application I normally navigate to "Script Log Statements" and I would see the output there. For gs.debug() how & where do I see the output? Please advise.
Thanks,
Johannes
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2020 04:09 PM
Go to the sys_app table (e.g. type sys_app.list in the Application navigator search box), find your scoped app record in the list and open it.
Down in the Related links, you'll see "enable session debugging" - click it.
You'll then see your gs.debug/gs.info/gs.warn/gs.error statements at the bottom of standard lists and forms and as of New York, you'll also see them in the Script Debugger on the session log tab.
There may be an easier way, but this is how I do it (since System Applications> Applications no longer brings you to sys_app.list).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2020 07:27 AM
FYI - A response to this post was featured on the Community Live Stream video. I invite you to watch the episode.
Video: Community Live Stream - 2020-01-06 - Developer Community - ServiceNow Community

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2021 12:34 PM
This may be helpful to someone. Expanding on the above answers... I find gs.log to be the most useful, because you can specify a Source parameter, and then filter the syslog table based on that value. gs.info, gs.error, and gs.warn are also very straightforward, and tiny bit less error-prone. Examples:
//SERVER SIDE DEBUGGING
gs.log("My gs.log message", "Phoenix"); //Log to table: syslog. Source "Phoenix". Level "Information".
gs.info("My gs.info message");
gs.error("My gs.error message");
gs.warn("My gs.warn message");
Output:
gs.debug works differently from all the others. Example:
gs.debug("My gs.debug message"); //Shown below FORM on client, *IF* "System Diagnostics - Session Debug" is first set to ON for the "log" object type. Also shown in the separate Session Log Window.
IF you have first enabled Session Logging for the "Log" object type...
And double-checked this in your Session Log window...
And then you trigger your code which makes a gs.debug() call...
THEN, you should be able to find the message in the Session Log Window...
Or, underneath the main content of a form, back on the client side.
But again, these gs.debug() messages will NEVER show up in the syslog table.