Logging I/O Messages to a File
When you start monitoring messages, IO Monitor allows you to log messages — record them to a file — as they are captured. You can either log messages to a new file (IO Monitor opens the file, logs the messages and then closes the file when you select Stop Capturing Messages) or you can append new messages to a log file that is already opened.
To Log Messages:
-
Prepare to run the application that makes calls you want to monitor. If you don't have an application, start and use Keysight's Interactive IO utility to communicate with an instrument.
-
Open IO Monitor.
- Select the I/O elements you want to log. Refer to Changing IO Monitor Settings. IO Monitor logs only the messages you select under Monitor Messages.
- Select the down arrow in the Start Capturing Messages button.
- Select Start Capture / Log to New Message File. This opens a dialog box allowing you to specify the directory and file name for the log file.
-
The default log file for Windows is C:\Users\<user>\Documents\Keysight\Keysight IO Libraries\IO Monitor\IoMonitorLog.xml .
-
The default log file for Linux is /opt/keysight/iolibs/IoMonitorLog.xml.
-
The dialog box also allows you to specify the maximum size of the logged file (1 to 1024 MB, 10 MB is the default).
Very large log files cannot be loaded into the IO Monitor Viewer. The size of file that can be loaded depends on your system configuration.
- When you click the OK button, IO Monitor begins monitoring and logging I/O messages to the specified file.
- Start your application or issue commands from Interactive IO.
- There are two ways to stop the message logging:
- First, if you select the Stop Capturing Messages button, the message capturing stops but the logging file remains open. This allows you to continue logging (appending messages) to the same file. Click the Start Capturing Messages button to resume logging to the file.
- To stop logging and close the log file, click the down arrow on the Stop Capturing Messages button. Then click Stop Capture / Close Message File. This closes the log file.
Notes
- Unless you specify a new file name in Step 5 above, the new file will overwrite the previous old file.
- You can open the logged file for viewing by selecting: File > Open Message File For Viewing... or by selecting the Open Message File button. This opens a second window on your PC with the specified log file.
-
From this window, you can also print the logged file: File > Print Messages.
For more information, refer to IO Monitor Log Viewer: Reviewing Previously Logged Data. Reviewing time fields in the log file
-
TimeStamp is the tick count since the last time the computer was powered on. This value will not be accurate if you reboot the computer after generating the trace file or copy the log file to another computer. This feature will be removed in the future release, and we recommend not using it.
-
UtcTime is the number of ticks elapsed since January 1, 1600, at 00:00:00.000 according to the UTC calendar.
IO Libraries Suite version 18.1 and above support UtcTime field, so if you are using an older version, you will need to upgrade.CopyConvert the UtcTime field from a big number to a human-readable time
// C# example code
DateTime dt = new DateTime(utcTime, DateTimeKind.Utc);
dt = dt.AddYears(1600);
dt = dt.ToLocalTime();
string humanReadTime = dt.ToString("HH:mm:ss.fff (yyyy-MM-dd)", DateTimeFormatInfo.InvariantInfo);