Script Logging and Print Statement Output Reference
Just as each script has its own events based on location that trigger the script to run, output logging is also dependent on where the script is executed. This page details where to find your print statements and logs to assist with script testing and debug. Refer to the following list for how to find the output logging locations:
- Script Console: Accessed using the top navigation bar in the Designer, selecting Tools > Script Console.
- Output Console: Accessed using the top navigation bar in the Designer, selecting Tools > Output.
- System logs: Located on the Gateway Status page under Diagnostics > Logs.
- Wrapper logs: Located inside the logs folder in the Ignition installation directory.
Designer Execution​
When executing a script anywhere other than Perspective and the Script Console in the Designer, print
and system.util.getLogger
will log to the Output Console.
Script Console​
print
will log directly to the Multiline Buffer on the right-hand side.system.util.getLogger()
orsystem.util.invokeAsynchronous
will log to the Output Console, not the Script Console Multiline Buffer.
Perspective​
Even when scripting in Perspective in the Designer, your script is being run on the Gateway. For this reason, it's recommended to use system.perspective.print
instead of the bare print
statement.
system.perspective.print
will log to the Output Console in the Designer.print
will show on the wrapper.log text files.system.util.getLogger()
will display on the Gateway system logs and the wrapper.log text files.
Certain errors from scripting are deliberately redirected to the Designer and don’t log on the Gateway, so keep in mind that some errors from a design session will appear to be “Designer local” when they are not.
Gateway Execution​
Gateway Event Scripts, Tag Event Scripts, SFCs, alarm pipeline scripts, and reporting scripts are all examples of scripts executing on the Gateway. In these scripts:
print
will show on the wrapper.log text files.system.util.getLogger
will show on the Gateway system logs and the wrapper.log text files.system.perspective.print
will not work (unless a Perspective session ID has been specified).
Perspective Session​
system.perspective.print
- If the scope is set to client, it will log in the browser console wherever the session is running.
- If the scope is set to gateway, the output is logged to the Gateway system logs.
- If the scope is not specified, it will be passed as client when running in the Designer and gateway when running in a session.
print
will show on the wrapper.log text files.system.util.getLogger
will show on the Gateway system logs and the wrapper.log text files.
Client Session​
From a Client, the Help > Diagnostics popup window will display print
statements in the Console tab.