/system/logging

logging

Rules that decide which log messages are kept and where they go. Each rule selects messages by their topics, and optionally by a regular expression, and passes them to an action from /system/logging/action. The...


system/logging

Type: Directory

决定保留哪些日志消息以及它们去向的规则。每条规则按主题并可选择按正则表达式选择消息,然后将它们传递给 /system/logging/action 中的操作。默认规则将 info、error 和 warning 消息传递给 memory 操作,将 critical 消息传递给 echo;其他消息(例如 debug)在规则请求之前不会被记录。请参阅 日志。

标志名称描述
Xdisabled规则已禁用。
Iinvalid规则无效。
*default四条默认规则之一:info、error 和 warning 发送到 memory,critical 发送到 echo。
Ymanaged
参数类型描述
topicsmulti { array-id, array-id, topic: super { ! , topic: enum } }消息必须携带的主题才能匹配。仅当消息包含列出的每个主题时才匹配:topics=dhcp,debug 匹配 DHCP 调试消息,而不是所有 DHCP 消息和所有调试消息。要记录多个主题,请为每个主题添加一条规则。没有主题的规则匹配所有消息,包括调试消息。 主题前的 ! 会排除携带该主题的消息,例如 topics=ntp,debug,!packet 会记录 NTP 调试消息但不包含数据包转储。主题在 日志 页面上描述。路由器接受:account、acme-client、amt、async、backup、bfd、bgp、bridge、calc、caps、certificate、clock、container、critical、ddns、debug、dhcp、discover、disk、dns、dot1x、dude、e-mail、error、event、evpn、fetch、firewall、gps、gsm、health、hotspot、igmp-proxy、info、interface、ipsec、iscsi、isdn、isis、kvm、l2tp、ldp、lora、lte、manager、mme、mpls、mqtt、mvrp、natpmp, netinstall, netwatch, ntp, ospf, ovpn, packet, pim, poe-in, poe-out, pon, ppp, pppoe, pptp, ptp, queue, radius, radvd, raw, read, rip, route, rpki, rproxy, rsvp, script, sertcp, simulator, smb, snmp, socksify, ssh, ssld, sstp, state, store, stp, system, telephony, tftp, timer, tr069, update, upnp, ups, vpls, vrrp, warning, watchdog, web-proxy, wiliot, wireguard, wireless, write, zerotier。
prefixstringText added in front of every message the rule passes, as <prefix>: <message>. The prefix is part of the stored and of the sent message.
regexstring与消息文本及其后的消息额外字段进行匹配的正则表达式。不匹配时,即使主题匹配,规则也不会传递该消息。
actionenum接收匹配消息的 /system/logging/action 操作。每条匹配的规则都会将消息传递给自己的操作;当两条规则将同一消息传递给同一个操作时,该操作只会收到一次。默认值:memory。