Mikrotik Tutorial: How to configure persistent logging

Mikrotik Tutorial: How to configure persistent logging

The default logging configuration on a MikroTik router is to only keep logs in memory. When the router reboots the logging history is erased. In this article I will show you the simple steps to configure persistent logging to disk.

Steps to configure persistent logging

  1. In Winbox, choose System | Logging
  2. On the Rules tab, double-click each default rule
  3. Click Copy and change the Action dropdown to disk
  4. Press OK to save the new rule
  5. Repeat these steps for each of the 4 default logging rules (critical, error, info, and warning).

Here is what my logging rules look like after creating the 4 new rules.

Log File Retention Settings

Under the Actions tab, you can define the filename, file size and number of rotated log files to keep.  For disk performance reasons, I recommend a max of 4096 lines per log file.  You can also prefix the filename with the path to an external usb thumb drive to keep your logs separate from the built-in flash memory.

One side affect to configuring persistent logging is that the WinBox Log viewer will show duplicate entries.  To remove the duplicates, choose either memory or disk from the top, right-hand dropdown.  It will revert to all each time you reopen the Log window.

Now when you router reboots your log file(s) will be preserved.  Thanks for following along and I hope this tutorial helped you out.  Leave a comment below and checkout my other MikroTik Tutorials


One Reply to “Mikrotik Tutorial: How to configure persistent logging”

  1. Thanks for making a significant amount of knowledge available. I run a small (600 uTiks) rural ISP, and effective management is quite tricky. Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.