/log
log
Log entries the router keeps in memory: the default memory buffer, the buffers of other memory actions and the newest entries of disk actions. /log/print lists the entries of every buffer; where buffer= limits the...
log
Type: Directory
路由器保存在内存中的日志条目:默认的 memory 缓冲区、其他内存操作的缓冲区以及磁盘操作的最新条目。/log/print 列出每个缓冲区的条目;where buffer=<action name> 将输出限制为其中一个,follow 持续打印新条目,follow-only 仅打印新条目,with-extra-info 附加额外字段,file=<name> 将输出保存到 <name>.txt。/log/info、/log/warning、/log/error 和 /log/debug 命令会添加一条主题为 script 和相应级别的消息,与脚本中的 :log 相同。保留哪些消息由 /system/logging 中的规则设置。请参阅 日志。
| 只读参数 | 类型 | 描述 |
|---|---|---|
buffer | enum | 条目所属的缓冲区:memory 表示默认缓冲区,或其他内存操作或磁盘操作的名称。磁盘操作的最新条目会显示在此处,重启后则显示其活动文件的条目。不带过滤器的 /log/print 会列出每个缓冲区,因此传递给多个操作的消息会按每个操作显示一次。 |
time | date | 添加条目的日期和时间。 |
topics | multi { array-id, topic: enum } | 条目的主题,例如 system,info,account。/system/logging 中的规则按这些主题选择消息。 |
message | string | 条目文本;当规则具有 prefix 时,会在前面加上该前缀。 |
extra-info | string | 某些消息携带的额外 key=value 字段,例如登录:app=ssh duser=admin outcome=success src=192.0.2.1。print with-extra-info 会将它们附加到消息中,cef 远程日志格式会在 msg= 之后发送它们。 |