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,572 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 01:07 PM
Can anyone update their links?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 02:19 AM
Yes, there is an alternative way of logging for application scope. You can use the GlideSystem method "gs.info()", "gs.debug()", "gs.warn()", and "gs.error()" for logging in application scope. Here is a sample code:
javascript
gs.info('This is an info message');
gs.debug('This is a debug message');
gs.warn('This is a warning message');
gs.error('This is an error message');
Here are the steps to implement it:
1. Open the script or server-side code where you want to add the logging.
2. Use the "gs.info()" method for logging informational messages. This method takes a string as an argument which will be the log message.
3. Use the "gs.debug()" method for logging debug messages. This method also takes a string as an argument.
4. Use the "gs.warn()" method for logging warning messages. This method takes a string as an argument.
5. Use the "gs.error()" method for logging error messages. This method takes a string as an argument.
6. Save and test your script.
Remember, these logs will be visible in the system logs which can be accessed by navigating to "System Logs > All" in the ServiceNow application navigator.
nowKB.com
If you want to know any information about Service Now . Visit to https://nowkb.com/home