Text document of last event



I’m looking to add a counter to my camera.
Ideally, I’m looking for a way that whenever a last event is triggered that the time and date is recorded in a text document of some sort.

any suggestion on how to best approach this?

thanks a bunch