As with client-side scripting, there are a few ways to test server-side scripts. These are generally less immediate than the client-side debugging techniques, but essential when working to fix your code.
Testing server-side scripts
gs.log
The first logging technique we will look at is gs.log. This was a very popular technique, and still is fairly widely used by developers. As we saw in Chapter 2, Exploring the ServiceNow Glide Class, gs.log lets us send logs to the system log with a script source so we can send messages as a piece of code executes.
We can create a gs.log from any server-side script, which makes it very useful; however, we cannot use it in a scoped application. We will have a look at scoped...