What’s the best way to write to a log file every time a transaction is processed?
What I have always been doing is:
- Build Data Table in Init State (Provided I am using ReFramework)
- Add Data Row in Finally block of Process State (so that a new row will be added whether the transaction was successful or unsuccessful
- 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?