Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

What is the difference between gs.log() and gs.print()?

antonymirza
Tera Expert

I have a confusion when to use what i.e. gs.log() or gs.print() as both [gs.log() and gs.print()] writes to system log file.

Anybody please explain the difference...

1 ACCEPTED SOLUTION

eric_szonyi
ServiceNow Employee

I believe gs.print() will write an entry to the Log File, while gs.log() will write to both the System Log and the Log File as well as give you an option to specify the Source. Both default to "*** Script".


View solution in original post

10 REPLIES 10

Vivek Verma
Giga Sage

The major difference between gs.log() and gs.print() is that gs.log() is not working in Scoped Application.

So for Scoped Application, You must consider gs.info().