date sounds good and in fact I tried that and played around but below you can see an example in the output of the script in the log file when it runs.
root@HyperGW:~# cat /root/logfiles/hotplug/Wan1.log
+ '[' ifdown '==' ifup ]
+ date
Wed Mar 25 00:24:16 EET 2020
+ '[' ifup '==' ifup ]
+ '[' Wan1 '=' Wan1 ]
+ jsonfilter -e '@["ipv4-address"][0].address'
+ ubus call network.interface.Wan1 status
+ INET=172.16.100.2
+ uci set 'openvpn.Wan1.local=172.16.100.2'
+ uci commit openvpn
+ /etc/init.d/openvpn restart Wan1
+ date
Wed Mar 25 00:24:20 EET 2020
+ '[' ifdown '==' ifup ]
+ date
Wed Mar 25 00:24:20 EET 2020
No matter where I use the date it pops up in the log several times and that because of the transitions that the interface goes. So my idea was to have something at the start and at the end of the log.
------ START of log "date" ----------
output
------ END of log "date" ----------
Or something on each line. I might missing something.