- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
.Which is one that performs debug logging in server side?
a. Gs.debug()
b. Gs.log()
c. Gs.print()
d. Gs.info(
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Pranai
b) gs.log()
The most commonly used server-side debug methods are:
- gs.log: used for global applications. This option writes messages to the Log [syslog] table and the localhost log. Also when using Background Scripts it prints the message to the browser screen.
- gs.print: used for global applications. This option writes messages to only the localhost log. Also when using Background Scripts it prints the message to the browser screen.
- gs.debug: used for scoped applications. This option writes messages to the Log [syslog] table and the localhost log. Also when using Background Scripts it prints the message to the browser screen.
If using gs.log (“message”,”source”), there is a second source parameter available called source. It is essential to use this second parameter as it will make it much easier to find the log output if you want to locate it in the Log [syslog] table.
It is recommended to put your debug statements near the failing area of the script or after a part of the script that you are trying to understand better. Add as much information in the message as needed to make the output more understandable.
See the reference
ServiceNow Things to Know 88: Debug Server-Side Sc... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Pranai please specify what scope:
- for Global scope: B or D
- for Custom scope: D
I always gs.info() everyhwere :))
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Pranai
b) gs.log()
The most commonly used server-side debug methods are:
- gs.log: used for global applications. This option writes messages to the Log [syslog] table and the localhost log. Also when using Background Scripts it prints the message to the browser screen.
- gs.print: used for global applications. This option writes messages to only the localhost log. Also when using Background Scripts it prints the message to the browser screen.
- gs.debug: used for scoped applications. This option writes messages to the Log [syslog] table and the localhost log. Also when using Background Scripts it prints the message to the browser screen.
If using gs.log (“message”,”source”), there is a second source parameter available called source. It is essential to use this second parameter as it will make it much easier to find the log output if you want to locate it in the Log [syslog] table.
It is recommended to put your debug statements near the failing area of the script or after a part of the script that you are trying to understand better. Add as much information in the message as needed to make the output more understandable.
See the reference
ServiceNow Things to Know 88: Debug Server-Side Sc... - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Pranai please specify what scope:
- for Global scope: B or D
- for Custom scope: D
I always gs.info() everyhwere :))
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */