The CreatorCon Call for Content is officially open! Get started here.

Where does gs.print output go?

johannes5
Giga Expert

Hi ServiceNow Community Developers,

In a script include if I put gs.log statement I can go to Script Log Statements to see my output and that works fine. I am currently looking at a script include that has gs.print statements and after running it I can't find the output. Any idea where can I go to look at the output from the gs.print statement. Please advise.

Thanks,

Johannes

6 REPLIES 6

David OBrien
Kilo Guru

Typically you would only see gs.print display if you were running as a background script where you could actually see the feedback from the script being run.   However, if you actually download the log file (System Logs > Node Log File Download) you would be able to see the results of gs.print statements there as well.


I was not able to see the gs.print() outputs of a script executed using the "Scripts - Background" tool when I searched a Node Log File Download. Perhaps I was doing it wrong - but I thought I should provide some feedback.

raghavendra_jay
Giga Contributor

gs.print is usually used to test your scripts/execute a one time script by running it from System Definition > Scripts Background.


gs.log is more commonly used in your other scripts like script include, business rules etc. where you want to make a log or debug a code.


I am not seeing any of my gs.log statements that I have entered into my client UI action. How can I debug this UI action using gs.log || gs.print please?