How do you turn off SQL output when running a script in "Scripts - Background"?

seberly
Giga Expert

Getting something similar to the following for scripts run through the "Scripts - Background" module:

Time: 0:00:00.002 id: <instance name redacted>[glide.10] for: SELECT task0.`sys_id` FROM task task0 WHERE task0.`sys_class_name` = 'sc_req_item'....

It seems the equivalent SQL is being output for every GlideRecord DB transaction.   Thoughts?

Thanks,

Scott

1 ACCEPTED SOLUTION

Mwatkins
ServiceNow Employee
ServiceNow Employee

Do you have the glide.db.trace property set to true in your instance? (check the sys_properties table)


If it doesn't exist, try adding it and setting it to type boolean or string with value "false"


View solution in original post

11 REPLIES 11

Chuck Tomasi
Tera Patron

Have you tried disabling debugging?



System Diagnostics> Session Debug> Disable All


Indeed.   Several times and nothing.   The SQL debugging output is not being displayed anywhere else but scripts.



Also, this is happening for all admins who run scripts in "Scripts - Background".


Hi Scott,



More details please - so I can try to reproduce it. I'm unable to now. I'm using Helsinki P1 and tried the following simple script and did not see any log messages.



var inc = new GlideRecord('incident');


inc.query();


gs.print(inc.getRowCount() + ' records found');



Please provide details of what you are doing (script and SN version are a good start) so I can try to reproduce it. Thanks.


Current version: Fuji P12.



The script is simple.   Just looking up a journal entries of some records on sc_req_item.   The behavior is present on every script that is run in "Scripts - Background".   Even something as simple as:



var gr = new GlideRecord('incident');


gr.query();



Output:


[0:00:00.578] Script completed in scope global: script



Time: 0:00:00.007 id: <instance name redacted>[glide.9] for: SELECT task0.`sys_id` FROM task task0   WHERE task0.`sys_class_name` = 'incident'


I can only reproduce this on one of our instances (they are all on Fuji P12).



Thanks,


Scott