gs.log or gs.info is not working in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2018 11:46 AM
Hi All,
I am using Dynamic Filter Option which calls script include. The script include has gs.log() statement which doesn't show up in system logs. What could be the issue?
Both Dynamic Filter and Script include are in Global application.
Thanks,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2018 12:55 PM
script include is:
function getMyGroupMembers(){
gs.info("Aj testing group members");
var myGroups = gs.getUser().getMyGroups();
var groupsArray = [];
var it = myGroups.iterator();
var i=0;
var groupMemberArray = [];
while(it.hasNext()){
var myGroup = it.next();
//Query for group members
var grMem = new GlideRecord('sys_user_grmember');
grMem.addQuery('group', myGroup);
//Only return active users
grMem.addQuery('user.active', true);
grMem.query();
while(grMem.next()){
//Add to user sys_id to array
gs.log("Aj testing inside loop for group members");
groupMemberArray.push(grMem.user.toString());
}
i++;
}
return groupMemberArray;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2018 12:59 PM
Is your dynamic filter working correctly when you comment out the gs.log statement?
My first guess would be that the script include isn’t being triggered at all or is failing before it gets to your log statement. Have you reviewed the logs for other errors relating to your script include? Could you also post the code you are using in both the dynamic filter and script include.
Thanks,
Brent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2018 09:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2018 09:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2018 03:34 PM
run a background script to see if gs.log statements are working or not in the first place. Check the results in Script Log Statements Module.
If you find the log statements from the background script then logging is not disabled in your instance, and the root cause may be the function in the script include is not being called.
In very rare occasions i saw the system property glide.script.log_level set to None , which disables gs.log statements in Global Scope. If you dont find this property in your system properties that's fine(it doesn't come by default, we have to create it if we want to disable the logging)