How to add logging for a scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2015 02:58 PM
Trying to use GSLog for logging in an application scope, but it is restricted to only global scope and inaccessible from a private application scope.
Is there an alternative way of logging for application scope?
- 25,565 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2015 07:02 PM
Use gs.info() instead. The results end up in System Logs >> Application Logs instead of Script Log Statements.
Scoped GlideSystem API Reference - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2016 12:44 PM
Amit, Does this answer your question? If so, please mark it as the correct answer. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 06:47 PM
Scoped API for logging
The Scoped Logging API provides four levels of verbosity. In order from least verbose to most, they are:
Log Level | Description |
---|---|
error (gs.error) | Logs events that might still allow the application to continue running. Setting the log level for an application to error generates error messages only, but does not generate warn, info, or debug messages. |
warn (gs.warn) | Logs potentially harmful events. Setting the log level for an application to warn generates error and warn messages, but does not generate error or debug messages. |
info (gs.info) | Logs informational messages that describe the progress of the application. Setting the log level for an application to info generates info, warn, and error messages, but does not generate debug messages. |
debug (gs.debug) | Logs informational events that are useful for debugging an application. Setting the log level for an application to debug generates info, warn, error, and debug messages. |
Best practice for scoped applications is to create two system properties to control the destination of verbosity of logging.
All scoped applications have two properties for control logging verbosity and destination. System properties are available by application for configuring log verbosity and destination, and for turning session debugging on or off:
Property | Description |
---|---|
scope_name.logging.destination | Configuring the log destination: file system or db.
|
scope_name.logging.verbosity | Configures log verbosity: error, warn, info, debug, or trace.
|
Scoped Script Logging - ServiceNow Wiki
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2016 07:49 PM
Hi Amit,
You may find the below link on developers portal helpful with detailed examples.