Skip to content

Log

RouterOS maintains a log of system events, errors, and traffic information. Every log message carries one or more topics (facility and severity tags) that identify its origin and importance. You control what gets logged and where it goes by configuring rules (what topics to capture) and actions (where to send the output — memory, disk, remote syslog server, or email).

RouterOS logging uses two menus:

MenuPurpose
/system loggingRules — which topics to capture and which action to send them to
/system logging actionActions — destinations for captured messages (memory, disk, remote, email, echo)

The /log menu provides read-only access to messages stored in memory by the default memory action.

Sub-menu path: /log

Log entries stored in memory can be viewed in the CLI or WinBox.

# Print all logs (paged)
/log print
# Print without paging (useful for scripting)
/log print without-paging
# Follow live log output (Ctrl+C to stop)
/log print follow
# Filter by topic
/log print where topics~"error"
/log print where topics~"warning|critical"
/log print follow where topics~"firewall"
# Filter by message content
/log print where message~"login failed"
/log print where message~"192.168.1"

Open the Log window from the main menu. Use the search/filter bar at the top to narrow entries by topic or message text. Color coding highlights different severity levels.

Each log entry contains three fields:

FieldDescription
timeTimestamp of the event (wall clock or uptime if clock is not set)
topicsComma-separated list of topic tags, e.g. system,info,account
messageHuman-readable description of the event

A configured prefix on a logging rule prepends a custom tag to the message, useful for identifying which rule captured a message.

Sub-menu path: /system logging

Rules define which messages to capture and where to send them. Each rule matches log messages by topic and forwards them to a named action.

PropertyDescription
topicsComma-separated list of topics to match. Multiple topics in one rule behave as OR — any matching topic triggers the rule. Prefix a topic with ! to exclude it.
actionName of the logging action (destination) to send matched messages to
prefixOptional string prepended to each message matched by this rule

Topics identify the source or severity of a log message. A single log entry can carry multiple topics simultaneously (e.g. dhcp,info).

Severity topics (apply to all subsystems):

TopicDescription
debugVerbose diagnostic output
infoNormal operational events
warningConditions that may require attention
errorErrors that affect functionality
criticalSevere errors requiring immediate attention

Facility topics (common subsystems):

TopicDescription
accountUser login and authentication events
bgpBGP routing protocol
capsCAPsMAN controller events
dhcpDHCP server and client
dnsDNS resolver
firewallFirewall rule matches (requires log=yes on firewall rules)
interfaceInterface state changes
ipsecIPsec/IKE negotiation
ospfOSPF routing protocol
pppPPP/PPPoE connections
ripRIP routing protocol
scriptScript execution output
snmpSNMP requests
systemGeneral system events
wirelessWi-Fi client associations, roaming, authentication

Topics can be combined: topics=firewall,warning matches messages tagged with both firewall AND warning.

RouterOS ships with default logging rules that send common topics to the memory action:

# View default rules
/system logging print

Default rules typically capture info, warning, error, and critical topics to the built-in memory buffer.

# Log all firewall matches to memory with a prefix
/system logging add topics=firewall action=memory prefix=FW
# Log DHCP events separately
/system logging add topics=dhcp action=memory prefix=DHCP
# Log wireless events
/system logging add topics=wireless action=memory prefix=WLAN
# Log only critical and error-level OSPF events to remote syslog
/system logging add topics=ospf,error action=remote
/system logging add topics=ospf,critical action=remote
# Exclude debug from a catch-all rule
/system logging add topics=!debug action=memory

Sub-menu path: /system logging action

Actions define destinations for log messages. RouterOS includes several built-in actions and supports creating custom ones.

TargetDescription
memoryStores messages in a RAM buffer, accessible via /log print
diskWrites messages to a file on router storage
remoteSends messages to an external syslog server (UDP, RFC 3164/BSD syslog)
echoPrints messages to the console/terminal
emailSends messages via email (requires /tool e-mail configured)
PropertyDescription
nameAction identifier
targetmemory
memory-linesNumber of log lines to keep in the buffer (default: 1000)
memory-stop-on-fullIf yes, stop logging when buffer is full instead of rotating
# Create a dedicated memory buffer for DHCP logs
/system logging action add name=dhcpLog target=memory memory-lines=500
# Bind DHCP topics to it
/system logging add topics=dhcp action=dhcpLog

Logs to a file on the router’s local storage. The directory specified in disk-file-name must already exist — RouterOS will not create directories automatically.

PropertyDescription
nameAction identifier
targetdisk
disk-file-namePath and base filename for the log file
disk-lines-per-fileMaximum lines per file before rotation
disk-file-countNumber of rotated files to keep
disk-stop-on-fullStop logging when storage is full
# Create a disk logging action
/system logging action add \
name=diskLog \
target=disk \
disk-file-name=router \
disk-lines-per-file=1000 \
disk-file-count=10
# Log warnings and above to disk
/system logging add topics=warning action=diskLog
/system logging add topics=error action=diskLog
/system logging add topics=critical action=diskLog

Prints log messages directly to the active terminal/console. Useful during live troubleshooting sessions.

# Echo is a built-in action — just create a rule pointing to it
/system logging add topics=debug,wireless action=echo

Forwards log messages to an external syslog server using the BSD syslog protocol (RFC 3164, UDP). This is the primary method for centralizing logs from multiple routers.

PropertyDescription
nameAction identifier
targetremote
remoteIP address of the syslog server
remote-portUDP port (default: 514)
bsd-syslogUse BSD syslog framing (yes/no)
syslog-facilitySyslog facility code to use when forwarding
syslog-severityOverride the severity in outgoing messages

Common syslog facility values:

FacilityName
kernelkernel messages
useruser-level messages
mailmail system
daemonsystem daemons
authsecurity/authentication messages
syslogmessages generated internally by syslogd
local0local7locally defined facilities (commonly used for network devices)

Sends log messages via email. Requires /tool e-mail to be configured with SMTP server details.

# Configure SMTP settings first
/tool e-mail set server=smtp.example.com port=587 from[email protected]
# Create a custom email logging action
/system logging action add name=emailAction target=email
# Add a rule to send critical events by email
/system logging add topics=critical action=emailAction

Sending logs to a central syslog server is the recommended approach for production routers. It provides longer retention, correlation across devices, and alerting without storing logs on the router itself.

# Step 1: Create a remote logging action
/system logging action add \
name=to-syslog \
target=remote \
remote=192.0.2.10 \
remote-port=514 \
bsd-syslog=yes \
syslog-facility=local0
# Step 2: Create rules to forward relevant topics
/system logging add topics=info action=to-syslog
/system logging add topics=warning action=to-syslog
/system logging add topics=error action=to-syslog
/system logging add topics=critical action=to-syslog

For SIEM integration or security monitoring, forward only the topics relevant to security events:

/system logging add topics=account action=to-syslog prefix=AUTH
/system logging add topics=firewall action=to-syslog prefix=FW
/system logging add topics=critical action=to-syslog prefix=CRIT

Some syslog collectors (e.g., Graylog, Logstash) listen on custom ports:

/system logging action add \
name=to-graylog \
target=remote \
remote=10.10.1.50 \
remote-port=5514 \
bsd-syslog=yes \
syslog-facility=local1

This example configures local disk logging for retention and remote syslog for real-time monitoring:

# 1. Create disk action for local retention
/system logging action add \
name=secDisk \
target=disk \
disk-file-name=security \
disk-lines-per-file=2000 \
disk-file-count=10
# 2. Create remote syslog action
/system logging action add \
name=secRemote \
target=remote \
remote=10.0.0.50 \
remote-port=514 \
bsd-syslog=yes \
syslog-facility=local0
# 3. Log security topics to both destinations
/system logging add topics=account action=secDisk prefix=AUTH
/system logging add topics=firewall action=secDisk prefix=FW
/system logging add topics=critical action=secDisk prefix=CRIT
/system logging add topics=error action=secDisk prefix=ERR
/system logging add topics=account action=secRemote prefix=AUTH
/system logging add topics=firewall action=secRemote prefix=FW
/system logging add topics=critical action=secRemote prefix=CRIT
/system logging add topics=error action=secRemote prefix=ERR

Enable verbose debug logging during troubleshooting, then clean it up:

# Enable debug logging temporarily
/system logging add topics=wireless,debug action=memory prefix=DBG-WIFI
# Reproduce the issue, then search logs
/log print where topics~"wireless" where message~"association"
# Remove the debug rule when done
/system logging remove [find prefix=DBG-WIFI]
# Create dedicated memory buffers
/system logging action add name=bufDhcp target=memory memory-lines=500
/system logging action add name=bufWireless target=memory memory-lines=1000
/system logging action add name=bufFirewall target=memory memory-lines=2000
# Bind topics to each buffer
/system logging add topics=dhcp action=bufDhcp prefix=DHCP
/system logging add topics=wireless action=bufWireless prefix=WLAN
/system logging add topics=firewall action=bufFirewall prefix=FW
  • Syslog with Elasticsearch — Centralized log analysis using Elastic Stack
  • Netwatch — Monitor host availability and trigger scripts on state changes
  • SNMP — Alternative monitoring protocol for metrics collection
  • Traffic Flow — NetFlow/IPFIX export for traffic analytics