What's the best way to write to a log file every time a transaction is processed?

What’s the best way to write to a log file every time a transaction is processed?
What I have always been doing is:

  1. Build Data Table in Init State (Provided I am using ReFramework)
  2. Add Data Row in Finally block of Process State (so that a new row will be added whether the transaction was successful or unsuccessful
  3. Write Range in End State

However, the problem with this is, if you are running the robot and for whatever reason you need to stop the execution halfway through, you won’t get a log file because Write Range happens only in End State.

So, I would, instead, like to write to a file every after a transaction is processed, maybe in Finally block of Process state.
I am not sure what the best way to do so. Write Range and Append Range* both require a DataTable. But what I want to do is, just add a row every time a transaction is processed, so to me, it doesn’t really make sense to create a new DataTable for this.

I thought about using Write Cell also, using Transaction ID number for the row number to write to. Is this the best way to do it?

Hy @tomato25,

You could try the following:
Build a log data table in the init state
Add a data row for each transaction item
Use the append range to print this data to excel
Clear the data table at the end of transaction item

What do you think about that?
Regards