How do add logs to my custom script to check for errors?

thrsdy1512
Tera Expert

Hi 

 

I have a custom script which is causing issues but I would like to add logs to it to confirm what exactly in that script is causing the problem. How can this be done?

 

Is there any other way to check this without logs? 

 

Thanks

2 REPLIES 2

Stefan Reichelt
Tera Guru
Tera Guru

Hi,

For general information about logging, see this documentation page:

GSLog | ServiceNow Developers

 

If you post your script here, we can maybe also give you some hints.

 

Best regards

Sandeep Rajput
Tera Patron
Tera Patron

@thrsdy1512 You can use gs.log() in the global scope or gs.info() in the scoped application after different lines to check where exactly your script is breaking. 

 

Also, would it be possible to share your script here. We may be able to help you out in finding the the issue with your script.