Logging in Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2019 09:51 AM
Hello,
I am using Madrid and facing an issue in logging in script include.
Code snippet of logging present in script include, which is called on form submission (through client script) :
var gl = new global.GSLog("com.bt.userprov", "UserProv");
gl.loginfo("Test logging");
Upon form submission, I don't see this log in System Log > Script Log Statements. I search for 'UserProv' under Source but couldn't find anything.
Am I looking for logs of script include at correct place? Is there any other way to generate script include logs?
Please help.
Thanks in advance.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2019 04:19 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2023 03:54 AM
Hi just poking around older posts.
The very handy GSLog does log to the System Log > Script Log Statements , it is just that the default filter for Script Log Statements is "Created on Today, Source equals *** Script" - change the Source condition to "contains *** Script [" and all will be revealed.
GSLog appends an optional string to the Source in square brackets e.g. *** Script [UserProv]
GSLog is very handy as it can be used for "production strength" logging - controlled appropriate levels of logging, grouped by named process or area. Individual process logging can be switched off altogether by property.
Millisecond timestamps can be added to the log message for exact chronological order (not jumbled randomly across one second period).
Here's a trivial example :
var logger = new global.GSLog('ubs.ACME.gslog_level', "Roadrunner logs");
logger.includeTimestamp();
logger.logDebug("policy_exception = something ");
More scripted examples here ...
https://www.servicenow.com/community/developer-forum/gslog/m-p/2464106/highlight/true#M962111