How to Remove Mikrotik Logs

How to Remove Mikrotik Logs

Logging Features On Mikrotik

One of the features on Mikrotik that looks simple and may also be forgotten but has a fairly important function is the LOGGING feature.
RouterOS is capable of logging various system activities and router status information.

By default RouterOS will record all activities and processes that occur on the router and store the log in RAM. The list of records (Log) can be seen in the /log menu.
Logs that are in the /log menu will disappear once we restart the router because the logs are only stored in RAM.

Example display on the menu / log via winbox.

Intsall Foam Inside The Keyboards C...
Intsall Foam Inside The Keyboards Case

In solving network problems it will be more effective by previously analyzing the logs from the Router to find out what processes have occurred. So it will be easier to map the problem and determine the solution.

We get too much information if we only look at the /log menu, so it might be difficult to analyze. For that we can do whatever topic settings will be recorded and will be stored or displayed where the log is.

In addition to being stored in the router’s memory (RAM), logs can also be stored in the form of a file on the router’s storage, sent via email or displayed on a separate syslog server device.

This setting can be done in the /system logging menu.

If you notice there are 2 tabs on the / system logging menu, namely the Rules tab and the Action tab.

Action tab (/system logging action)

Used for setting the log storage method. There are 5 Types of Action that we can use:

1. Disc Type

With this type the log will be stored in the form of a text file and will be stored on the Router’s own storage system. We can set the name of the log file when it is stored in the File Name parameter. You can also set how many log lines are stored in each file, you can set the Lines Per file parameter.

The log file can then be downloaded from the Router’s Files menu and can be opened with a text editor on a PC

2. Echo Type

By using this type the log from the router will be displayed in the New Terminal (winbox) or when we remotely use the CLI (direct console)

3. Email type

The log will be sent to the email that we have specified. In order for it to work, we must first set up the SMTP server that we will use in the /tool email menu

How often the email is sent will be equal to how often the Router updates logs. Our advice, don’t use public email services (such as Yahoo! or Gmail) because if you send emails too often, public email services will usually consider it spam.

4. Memory Type

Logs will be stored in the RAM Router and we can see on the Log menu. Because it is only stored in RAM, this log will be erased / cannot be read again after the router reboots.

5. Remote Type

The logs will be sent to another device running the syslog server. We just point to the machine that runs the syslog server by filling in the IP Address.

If the action has been created, the next step is to create a rules log.

Rules tab (/system logging rules )

In this rule tab, we can set any topic or service that we will record in the log. So that we can observe a process or service more specifically.

There are many services in our router and in a rule that we create, we can specify one or more topics that we will record in the log.

In the following example we will log all webproxy processes in a simple (!debug ).

This !debug topic is optional. This means that even without the topic !debug logging webproxy will continue to run. !debug is used so that the log display is not too detailed. By default, if we specify a logging topic, there will be detailed information on the processes that occur on the machine which can sometimes be confusing.

For example, when logging a webproxy topic (!debug) with a remote action so that the log will be sent to a machine (PC) running a syslog server (172.16.1.254) with a simple syslog application from Mikrotik for Windows called MTSyslog.

The following image shows the log view viewed in the MTSyslog application
You can download the MTSyslog application for free here.

By using this logging function, we do not need to continuously observe the processes that occur on the router all the time. We only need to look at the results of the existing process logs to find out what happens as long as you don’t observe the router directly.

How to Remove Mikrotik Logs as follows:

How to remove/delete Logs in Mikrotik? This question may appear when you open the Log and want to delete it but there is no menu or command to delete the Mikrotik Log.

Indeed, on Mikrotik there is no menu or command to delete Mikrotik Logs. However, we can still outsmart it by minimizing the log display that appears on Mikrotik.

1. Login to Mikrotik via Winbox

2. In the terminal enter the following command:

/system logging action set memory memory-lines=1

3. The Mikrotik log list will disappear leaving only 1 line.

4. To restore it to the original can use this command:

/system logging action set memory memory-lines=100

Okay, that’s how to get rid of Mikrotik Logs. Please try and hopefully useful 🙂