When troubleshooting or monitoring an Ignition system, it is very important to make a good use of logs. This article goes over the purpose of various Ignition logs and explains how to obtain them.
- The Gateway Log
- The Wrapper Log
- Thread Viewer and Thread Dumps
- Client Console and Client Diagnostic Tools
- Designer Console
- Java Console
The Gateway Log
Gateway log contains information about the operation of Ignition Gateway and its sub-systems. For example, database connection errors, OPC and device connection errors, alarm notification errors, etc., will be posted to the Gateway log. Gateway-scoped resources of the projects will also post errors to the Gateway log. These include (but are not limited to) Gateway and Shared script errors, sequential function chart errors, alarm pipeline errors, etc.
Additionally, the loggers obtained using the system.util.getLogger function within Gateway scoped resources will also output to the Gateway log.
Taking a Gateway log export
To obtain a Gateway log export, go to the Gateway’s Status / Diagnostics / Logs page and click on the "Download" icon.
This will download a file with the name containing “system_logs” and the current timestamp, and an extension of .idb, for example: system_logs_19May2017-18-44-45.idb
The file is a SQLite database and can be viewed with a SQLite front end of your choice.
Ignition versions 7.8.x or older:
To export the Gateway log on Ignition versions 7.8.x or older, go to your Gateway's Configure / System / Console page, and click on the "export logs" link on the right.
This will download a file called logs.bin.gz. Inductive Automation Support has the tool necessary to view this file. Please send it in as-is (do not attempt to extract the archive).
Changing logging levels
You may be advised by Support to change the logging level of a particular logger (or loggers) prior to replicating the issue and obtaining the log export.
To change logging levels, go to the Gateway's Status / Diagnostics / Logs page and click on the "gear" button. On the Log Configuration popup that will open, search for the logger name in the Filter box, and select the desired logging level from the dropdown to the right of the logger name
Ignition versions 7.8.x or older:
To change logging levels on Ignition versions 7.8.x or older, go to your Gateway's Configure / System / Console page, switch to the Levels tab, search for the logger name and use the dropdown on the right to change the logging level.
The Wrapper Log
Wrapper logs are a set of plain text log files located inside the installation directory on the computer where Ignition Gateway is installed. The exact path may vary depending on the installation directory, but the typical path to the location of the wrapper logs is C:\Program Files\Inductive Automation\Ignition\logs\ on a Windows operating system, /var/log/ignition on a typical Linux installation, and /usr/local/ignition/logs/ on a typical Linux ARMHF installation.
Note that the location of the wrapper log may change, due to user configurations made to the ignition.conf file. The ignition.conf file is located in %installDirectory%/data/ignition.conf (or the /etc/ignition directory on Linux). You can search the CONF file for "wrapper.logfile="" to see which directory the wrapper logs are located in.
Wrapper logs are similar to Gateway logs in that they contain information about the operation of the Ignition Gateway and its sub-systems, as well as the errors generated by Gateway scoped resources. However, there are some important differences between the Gateway log and the wrapper logs:
- The information in the wrapper logs persists across Gateway restarts, while Gateway logs are cleared by Gateway restart
- The wrapper logs contain information about issues during the Gateway startup, including any issues that may have prevented the Gateway from starting. The most recent wrapper log file is the first place to look for the cause if the Gateway has failed to start, or if the Gateway stopped or restarted unexpectedly.
- The wrapper logs (but not the Gateway log) contain the output of any print statements in Gateway-scoped scripts.
- There are typically six wrapper log files. The file containing the most recent information is the one called wrapper.log. Older information is contained in the wrapper.log.1, wrapper.log.2, wrapper.log.3, etc., the higher the number, the older the information. A very recent installation of Ignition may have fewer than six wrapper log files.
- Some operating system settings may cause the file extensions to be hidden. In that case, check your operating system’s documentation on how to show file extensions, or simply look for the files with the name starting with "wrapper"
- Unlike the Gateway log, the wrapper log files can only be obtained from their directory on the computer where Ignition Gateway is installed. There is no way to view them via the Gateway’s Web interface.
Thread Viewer and Thread Dumps
The thread viewer displays a snapshot of information about Gateway’s execution threads. This information may be important when troubleshooting certain types of issues. If you are working with Support, you may be asked for a thread dump.
In order to be useful, a thread dump must be taken at the time the issue is observed. Unlike logs, which maintain a record of past messages, a thread dump is a time-specific snapshot and will not contain a record of past states.
Getting a thread dump
To get a thread dump, go to the Gateway’s Status / Diagnostics / Threads, and click the "Download" button on the right. This will download a thread-dump.txt file.
Ignition versions 7.8.x or older:
To get a thread dump, go to the Gateway’s Configure / System / Console page, switch to the “Threads” tab, and click the “Download Thread Dump” button at the bottom of hte page This will download a thread-dump.txt file.
Client Console and Client Diagnostic Tools
Print statements and error messages from Client-scoped scripts, as well as errors from Client-scoped resources like windows and components, are output to the Client console.
- To view the Client console, make sure the Client window is in focus, and press
F7. This will bring up the Diagnostics popup window. To view the Client console, switch to the second tab ("Console").
- If your project does not have the "Hide Menu Bar" property checked, you can also access the Diagnostics window from the Help menu on the Client's menu bar.
- To save the Client console output for record or troubleshooting purposes, copy the contents of the Console into a text file.
- You can clear the console by pressing the "Clear" (eraser) button. This is useful if there are a lot of messages in the console making it difficult to see the most recent output you may be looking for.
- If you wish to see earlier log messages (but not the print statements) after having cleared the console, you can use the "Log Viewer" tab of the Diagnostics window. The Log Viewer tab allows grouping messages by categories, or ungrouping them to see the messages in the order of occurrence. It also allows filtering messages by severity level.
- The Diagnostics popup also provides tabs for setting Client logger levels (the Logging Levels tab) and for checking the threads (the Thread Viewer tab).
It is important to remember that the Diagnostics console exists only for the lifetime of the Client. This means that if the Client is closed, that information is destroyed.
To view messages and print statements output from Client scoped resources during design time without launching a Client, you can use the Designer's Output Console. If it is not already open, you can open the Console from the Designer's top menu, Tools section.
Similar to the Client, the Designer also has a Diagnostics screen, which can be accessed from the Help section of the Designer’s top menu. Please refer to the "Client Console and Client Diagnostic Tools" section for an overview of the information the Diagnostics screen provides.
Java Console is useful when troubleshooting issues with launching Clients using Java WebStart. Java Console is not shown by default, but you can easily enable it from the Java Control Panel.
Please follow these instructions from Oracle on how to enable Java Console from Java Control Panel.
To open Java Control Panel on a Linux distribution (e.g. Ubuntu), open the terminal and type:
Next time you launch the Client or the Designer using Java WebStart, an additional window showing Java Console output will pop up showing information about the launch process.
To save the Java Console output, use the "Copy" button at the bottom to copy the text, and paste the text into a text file. Save the file.
It is important to remember that the Java Console window exists only for the lifetime of the Client (or Designer). When the Client (Designer) is closed, so is the Java Console window.