Debugging scripts
Debug scripts using session logs and ServiceNow AI Platform debugging tools such as a walk-through script debugger and error messages that display in the UI.
Debugging server-side scripts
Use the Script Debugger and session logs to debug server-side code. For more information, see Script Debugger and Session Log.
You can also use session debug to display error messages related to a server-side script that runs as a result of a client-side change. For more information, see Debugging sessions.
GSLog is a script include that simplifies script logging and debugging by implementing levels of log output, selectable by per-caller identified sys_properties values. For more information, see GSLog API.
Debugging client-side scripts
Use session debug to display debugging messages in the user interface. For more information, see Debugging sessions. Use the session log to view logging information for script includes and custom UIs, such as Agent Workspace.
You can also debug client-side scripts using browser-based developers tools.
Debugging applications and scopes
Use the application debugging options to understand how a script's application scope might affect your application, table, or record. You may need to update cross-scope privileges to troubleshoot scope access issues. See Debugging applications.
- Script Debugger and Session Log
The Script Debugger enables users with the script_debugger role to debug server-side JavaScript. Users with the log_debugger role can use the Session Log to view and download required logs. - Debugging sessions
Enable session debugging to display debugging messages in the user interface. - Debugging applications
Application developers can display debug messages about configuration records to help them troubleshoot issues. The Debug Scopes module provides information about the system switching between custom applications to run server-side scripts. - Debugging business rules
Debugging business rules can be achieved with resources available in the ServiceNow product. - Debugging classifications
You must add a system property to enable classification debugging. - JS Code Coverage Debug
JS Code Coverage Debug allows administrators and application developers to log the server-side scripts triggered during a user session and then review which lines of code the system ran. - JavaScript debug window
The JavaScript debug window appears in a bottom pane of the user interface when an administrator turns on debugging.
Parent Topic:Scripting