Implementing Status Logging in a FlexLogger Plug-in

Updated Sep 4, 2026

Environment

Software

  • FlexLogger
  • FlexLogger Plug-In Development Kit
  • LabVIEW

Status logging is the process of recording operational messages, warnings, and errors generated by a FlexLogger plug-in during runtime. Implementing status logging helps developers and users diagnose issues, monitor plugin behavior, and troubleshoot unexpected conditions by providing visibility into the plug-in's execution.
 
This article describes an approach for implementing status logging in a FlexLogger plug-in. To follow the steps in this document, you should already have a functioning plug-in developed using the FlexLogger Plug-in Development Kit.

  1. Open the LabVIEW project that is associated with your FlexLogger plug-in. 
  2. Open the Initialize.vi and add the Write Parameter.vi. As its name suggests, this VI will add a parameter to the plug-in. This will allow the user to enable and disable the status logging capability if desired. Please refer to the following image for more information:

This image shows how to configure the Write Parameter VI to add the functionality of enabling and disabling the Status Log capability for the plugin. It has been set as a boolean parameter.

 

  1. In the Project Explorer Window, open the .ctl file, which contains the private data of the LabVIEW class that is associated with your plug-in. 

This image shows the CTL file that needs to be modified  

 

  1. Modify the Cluster of class private data and add a File Path Control to it. This element will contain the path to the status log file for the plug-in.

This image presents the Status Log File Path placed inside of the cluster of class private data 

 

  1. In the Project Explorer Window, right-click on the .lvclass element and select New>> VI for Data Member Access...

This image shows how to create a new VI for data Access that is linked to the LabVIEW class that is created for the plugin

 

  1. In the Create Accessor dialog box, select Read from the Access drop-down list, enable the Create static accessor option, and click on Create.

This image shows the options that should be selected in the Create Accessor Dialog Box

 

  1. Modify the VI to write status information to a file. Refer to the images below for guidance. 

This image shows a section of the Status Log File VI which is responsible for writing data to the status log file

 

This image shows the information that is written to the status log file when an error does not occur

This image shows what happens with the Status log file VI when the parameter is set to false

As shown in the images above, the code was modified to write the following details to the status log file: 

    • Date and time. This data will be updated each time the plug-in executes a VI that is part of its operation sequence (Configure Session, Process, Cleanup Session, and Finalize)
    • VI that is being executed (VI Refnum input). This input is used with a property node to obtain the name of the VI that is calling this Status Log File.vi
    • Execution status or error information, indicating whether the operation completed successfully or returned an error or warning

Note: You can add more information or data to the status log file depending on your application requirements. 

 

  1. Modify the VI's name, icon and update the conector pane if required. For this example, this VI has been renamed Status Log File.vi
  2. In the Project Explorer Window, open the Configure Session.vi and add logic to create the log file and write its column headers. 
  3. Place the Status Log File.vi and wire its inputs accordingly. Refer to the images below for guidance. 

This image shows the configure session VI which contains logic for creating the file path and writing its headers

 

This image shows the rest of configure session VI which contains logic for creating the file path and writing its headers

As shown, the Configure Session.vi has been modified to create a new path every time the plug-in is loaded to FlexLogger and the Enable Status Log parameter that was previously defined is enabled. Additionally, at the end to the VI, the recently created Status Log File.vi has been wired. 

 

  1. Call the Status Log File.vi from Process.vi and Finalize.vi. Use the Configure Session.vi as a guide.  Note: Logging every execution of Process.vi may generate a large amount of data, depending on the plug-in execution rate. For production applications, consider logging only relevant events, errors, warnings, or state changes.
  1. For the Cleanup Session.vi, wire the Status Log File.vi as shown in the following images:

This image shows how to properly wire the Status Log file VI in the Cleanup Session VI of the FlexLogger Plugin

(Continuation) This image shows how to properly wire the Status Log file VI in the Cleanup Session VI of the FlexLogger Plugin

As observed, the Empty String/Path? function is used to determine whether the Status Log File.vi is executed. This is to prevent FlexLogger from displaying a dialog window asking for a file path the first time the Enable Status Log parameter is enabled. 

  1. Recompile the Packed Library, so the changes are included.

After recompiling the Packed Library in LabVIEW, and loading the plugin into FlexLogger the Enable Status Log option should appear in the plug-in configuration dialog as shown in the image below:

This image shows the Enable Status Log parameter in FlexLogger

If the parameter is enabled, the status log files will be generated and can be found in the User Documents directory, based on how the path was generated in the Configure Session.vi. If one of these files is opened, it contains information similar to the following:

This image shows the contents of a file generated by the plugin

 

 

 

Next Steps

For production environments, consider implementing a log retention or file rotation mechanism to prevent log files from accumulating indefinitely. For example, the plug-in could retain only the most recent log files or remove files older than a defined period.

Additional considerations may include limiting the log file size, configuring the log directory, and defining which message types should be recorded.