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

levin
ServiceNow Employee
ServiceNow Employee

Hi Chuck,



If I understand your question correctly, you want to hide all SQL statement in log.


The log will always print out any query longer than 100ms. This is hard coded and we can't change.


Unless the query is fast enough it will be shown in log.



This is very helpful when we diagnose the performance issue. I am not sure what is benefit to hide it. So far, only admin can view the log.


Hi Levin,



Good to know. BTW, Scott is the one with the question. From the looks of his sample output, it only took 7 milliseconds, that's far less than 100ms.


levin
ServiceNow Employee
ServiceNow Employee

I tried my Fuji Patch 13 and couldn't see SQL printed out either.


I would suggest Scott raise a support ticket to customer support.


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"


levin
ServiceNow Employee
ServiceNow Employee

I believe this is the answer! Thank you, Matthew.


I tried to set this property to be true (default was false), and I can see the statement printed.