register client vpn connections

Hello!
Due to the confinement due to the coronavirus, here in Spain our clients are teleworking from home, a client has asked me for a record of the connections made by each user, in principle it would be to record the connection and disconnection time
The quick solution was to create a log that is burned to disk with “ppp, info” and send this log every midnight, as a quick solution is fine but it is a bit cumbersome for my client to see what time they connect and disconnect
Is there any other method to record the connections of each VPN?
a style to
remote1:
connected 04/01/2020 09:00
offline 04/01/2020 13:58
connected 04/01/2020 15:39
offline 04/02/2020 01:00

and so with all users (or something similar)
does this exist? Or is the solution you set up the only one?

pd: sorry for the google translate

What i would do is setup the Email server on Mikrotik. It is really easy, go to tools → Email and there you must give the smtp server of your email, the port, set start TLS to yes or no, From is your Email and finally username and password…

After that, you can go on the PPP profile you use for the VPN Clients and at the last tab there is a “On UP script”…
There you can use the script Bellow:

foreach i in=[ppp active find where uptime < 10s ] do={
local name [ppp active get value-name=name $i];
local ipaddr [ppp active get value-name=caller $i];
:log info "Active PPTP connection with username: $name, IP Address of caller: $ipaddr";
/tool e-mail send to=yourEmail start-tls=yes body="Active PPTP connection with username: $name, IP Address of caller: $ipaddr" subject="PPTP connection";
}

I made some changes to the script, the source is here : http://forum.mikrotik.com/t/send-notification-mail-on-new-vpn-connection/70998/1

So basically what will happen, is as soon as a user is connected the script will run, it will check who is the user or users with uptime less than 10 seconds, because we need the new ones, and will imediatelly send as an email informing us of the user name that connected and its address…