Accessing Tomcat Logs In Real Time

Update: Just to add that these Tomcat logs are node specific. So if you want to watch another user’s transactions, you need to  be on the same node as that user. To switch nodes, you can use my Chrome Extension that’s on the store. More info is here

When trying to debug an issue, you add alert statements, log statements and info messages to a script attempting to understand what’s going wrong.

Often you can find the root cause relatively quickly. But other times, no matter how hard you look, something seems to be failing at a lower level. This is where the Tomcat server logs come in handy.

Accessing these usually requires downloading the log file and tracking down the exact time to find the issue.

The easier option is to watch the logs being written in real time with this simple Out of the Box UI Page and loading up whichever action your performing in one window, and watching the logs on the other window side by side: Continue reading

Help With Debugging ClientSide Scripts

Client side scripts are used extensively in ServiceNow. Whether from client script, UI scripts, UI policies, or back-end JS file includes (and a few other places but you get the point!).

It’s all fine until a script falls over and you get a javascript error. Checking the error in the javascript debugging console in whichever browser you choose will show you where it fell over but it’s not always clear exactly where this script lies and therefore where to fix it.

The issue (which is usually a very good thing by the way), is ServiceNow automatically puts all these client scripts that are needed to be loaded into big js_includes files. This basically gets all the scripts that need to be loaded, throws them into one big file and delivers it all at once, saving multiple round trips back and forward fetching each file.

So when a script fails, a lot of the times it’ll be in the js_includes file which doesn’t really help with debugging at all (well it does slightly help).
Continue reading