日志
openclaw logs
Section titled “openclaw logs”通过 RPC 跟踪 Gateway(网关) 网关 文件日志(适用于远程模式)。
相关:
--limit <n>:要返回的日志行最大数量(默认为200)--max-bytes <n>:从日志文件中读取的最大字节数(默认为250000)--follow:跟踪日志流--interval <ms>:跟踪时的轮询间隔(默认为1000)--json:输出行分隔的 JSON 事件--plain:不带样式格式的纯文本输出--no-color:禁用 ANSI 颜色--local-time:以您的本地时区渲染时间戳
共享 Gateway(网关) RPC 选项
Section titled “共享 Gateway(网关) RPC 选项”openclaw logs 也接受标准的 Gateway(网关) 客户端标志:
--url <url>:Gateway(网关) WebSocket URL--token <token>:Gateway(网关) 令牌--timeout <ms>:超时时间,以毫秒为单位(默认为30000)--expect-final:当 Gateway(网关) 调用由代理支持时,等待最终响应
当您传递 --url 时,CLI 不会自动应用配置或环境凭据。如果目标 Gateway(网关) 需要身份验证,请显式包含 --token。
openclaw logsopenclaw logs --followopenclaw logs --follow --interval 2000openclaw logs --limit 500 --max-bytes 500000openclaw logs --jsonopenclaw logs --plainopenclaw logs --no-coloropenclaw logs --limit 500openclaw logs --local-timeopenclaw logs --follow --local-timeopenclaw logs --url ws://127.0.0.1:18789 --token "$OPENCLAW_GATEWAY_TOKEN"- 使用
--local-time以您的本地时区渲染时间戳。 - 如果隐式 local loopback Gateway(网关) 请求配对、在连接期间关闭或在 Gateway(网关)
logs.tail响应之前超时,openclaw logsGateway(网关) 将自动回退到配置的 Gateway(网关) 文件日志。显式--url目标不使用此回退机制。 - 使用
--follow时,瞬态 Gateway(网关) 断开连接(WebSocket 关闭、超时、连接丢失)会触发带有指数退避的自动重新连接(最多重试 8 次,尝试间隔上限为 30 秒)。每次重试时会向 stderr 打印警告,并在轮询成功后打印一次[logs] gateway reconnected通知。在--json模式下,重试警告和重新连接转换均作为{"type":"notice"}记录输出到 stderr。不可恢复的错误(身份验证失败、配置错误)仍会立即退出。