Logging to disk when any vpn user is connecting or disconnecting

Hello Team,

I would like to log to disk when a l2tp user is connecting or disconnecting to the Mikrotik VPN server
Currently, with the default settings, I can see something like this:

12:26:42 l2tp,ppp,info <l2tp-user>: connected 
12:26:46 l2tp,ppp,info <l2tp-user>: disconnected

I need more lines for this (To have events from more days ago)
Also I added the following action:

/system logging action
add disk-file-name=vpn.log disk-lines-per-file=10000 name=VPN target=disk

If I add a rule for “l2tp” topic with this action, it continues being logged to memory
If I disable the rule for “info”, this is not logged
If I add a log prefix to the firewall rule which is accepting the l2tp connections, a lot of useless lines are logged

I did not found how to accomplish this.
Any idea?

Thanks in advance.
Regards,
Damián

Use “topics=l2tp” when setting up the logging rules.
Or “topics=ppp” or a combination of l2tp and ppp.

“topics=info” is logged to memory by default.
One can also negate things with “!”, like “l2tp,!debug”
To stop l2tp to come with the info, then use “info,!l2tp”.
One can have multiple lines with the same topic, but different additional conditions, and different actions.

.
Klembord-2.jpg

Thanks bpwl for your response,
When I tried this before, does not work but it does this time
I added the following rule:

/system logging
add action=VPN topics=l2tp,ppp,info

When only used the “l2tp” topic, I got more events (I dont need so much), so I had to use the 3 topics
I dont know why before did not work.

Thanks a lot
Regards,
Damián