Log DHCP users on Mikrotik 6.31

I would like to log users using network. I create own version from few different script to log dhcp assign operation on disk and sent it to me via e-mail.

/tool e-mail send to=“xxx” subject=([/system identity get name] . " Log " . [/system clock get date]) file=(“dhcpLog.0.txt”);
:wait 10;
/file set [find name=“dhcpLog.0.txt”] contents=“”
:log info ("System Log emailed at " . [/sys cl get time] . " " . [/sys cl get date]);
I add new log

4 dhcp dhcpLog dhcpLog
!debug
!packet
and new action for it

4 name=“dhcpLog” target=disk disk-file-name=“dhcpLog”
disk-lines-per-file=10000 disk-file-count=1 disk-stop-on-full=no
once a day MT sent to me e-mail

But.. I am worry about this solution.

Between sending e-mail and delay I can lose some logs.
I set file with “” value because I can’t create log file from script. With file, MT will not log. (How to create a new file by Mikrotik routers’ scripting)

You could also look at transporting DHCP events to a central place using syslog. If you want to stick with the email-the-file method, look at rotating the log to a new file first, then email the old log.