Nothing has to be done inside the script, only the path for the log file has to be defined. (first line)
The simple variant is to run this script in the ISE, since the variable can be adapted here as well.
The script automatically appends the log file with the current date and time, so nothing is overwritten and the data can also be stored for documentation purposes.
In addition, the respective sites within the logfile are displayed as follows.