Log variables to file action

You can use the Log variables to file action in the Log To File package to log user-defined variables to a log file. When an automation (bot) fails, you can use this action to troubleshoot issues offline by reviewing the log file and value of the variables for correctness.

Procedure

  1. In the Output file path field, browse and select the file path of the log file. If the specified log file does not exist, then a new log file is created at run time.
    Note: We support .txt format for the log file.
  2. In the When logging field, select one of the following options:
    • Append to existing log file: To append the content to an existing log file.
    • Overwrite existing log file: To overwrite the content in the log file.
  3. Append timestamp: Select this check box to add a timestamp. If you select this option, the log file will display information about the logging timestamp (date and time). For example, if you change the value of the variables at different times, you can select this option to pinpoint the date and time of the changes, and the Task Bot name these changes occurred.
  4. Select one of the following options from the Variables to log field:
    Note: We support logging user-defined variables of String, Number, Boolean, and Datetime data types only.
    • By type: You can use this option to log user-defined variables of basic data types based on type selection. You can log all String variables, all Number variables, all DateTime, and all Boolean variables simultaneously.
      Note: When you select the By type option, you can also log variables that are created later after you have added the Log variables to file action.
    • Custom selection: You can use this option to select and log individual variables of basic data types such as String, Number, DateTime, and Boolean.
      Note: If you created any new variable after you added the Log variables to file action to the bot and enabled the Select all variables check box, the new variable is not auto-selected and will not be logged even if you selected the Select all variables option. The variable appears unchecked in the Custom selection list where you must select that variable explicitly.

The following video shows how to log user defined variables to a log file.

See on how to use the Log variables to file action Example of using Custom selection option in Log variables to file action.