Use https://seceonhelp.freshdesk.com/support/login to access updated Knowledge Base Articles, Submit Technical Support Tickets and Review Status of submitted support tickets.

Mikrotik CCR1036-8G-2S+, RouterOS 6.49.5

Log messages

Sub-menu level: /log

Sub-menu level: /log

All messages stored in routers local memory can be printed from /log menu. Each entry contains time and date when event occurred, topics that this message belongs to and message itself.

[admin@MikroTik] /log> print jan/02/1970 02:00:09 system,info router rebooted sep/15 09:54:33 system,info,account user admin logged in from 10.1.101.212 via winbox sep/15 12:33:18 system,info item added by admin sep/15 12:34:26 system,info mangle rule added by admin sep/15 12:34:29 system,info mangle rule moved by admin sep/15 12:35:34 system,info mangle rule changed by admin sep/15 12:42:14 system,info,account user admin logged in from 10.1.101.212 via telnet sep/15 12:42:55 system,info,account user admin logged out from 10.1.101.212 via telnet 01:01:58 firewall,info input: in:ether1 out:(none), src-mac 00:21:29:6d:82:07, proto UDP, 10.1.101.1:520->10.1.101.255:520, len 452

If logs are printed at the same date when log entry was added, then only time will be shown. In example above you can see that second message was added on sep/15 current year (year is not added) and the last message was added today so only the time is displayed. 

Print command accepts several parameters that allows to detect new log entries, print only necessary messages and so on.

For example following command will print all log messages where one of the topics is info and will detect new log entries until Ctrl+C is pressed.

[admin@MikroTik] /log > print follow where topics~".info" 12:52:24 script,info hello from script -- Ctrl-C to quit.

 If print is in follow mode you can hit 'space' on keyboard to insert separator: 

[admin@MikroTik] /log > print follow where topics~".info" 12:52:24 script,info hello from script   = = = = = = = = = = = = = = = = = = = = = = = = = = =   -- Ctrl-C to quit.

Examples

Logging to file

To log everything to file, add new log action: 

and then make everything log using this new action: 

You can log only errors there by issuing command: 

This will log into files log.0.txt and log.1.txt.

You can specify maximum size of file in lines by specifying disk-lines-per-file. <file>.0.txt is active file were new logs are going to be appended and once it size will reach maximum it will become <file>.1.txt, and new empty <file>.0.txt will be created.

You can log into USB flashes or into MicroSD/CF (on Routerboards) by specifying it's directory name before file name. For example, if you have accessible usb flash as usb1 directory under /files, you should issue following command:

Seceon Inc. All rights reserved. https://www.seceon.com