






















@@ -0,0 +1,139 @@
1+---
2+title: "Diagnostics Export"
3+summary: "Create shareable Gateway diagnostics bundles for bug reports"
4+read_when:
5+ - Preparing a bug report or support request
6+ - Debugging Gateway crashes, restarts, memory pressure, or oversized payloads
7+ - Reviewing what diagnostics data is recorded or redacted
8+---
9+10+# Diagnostics Export
11+12+OpenClaw can create a local diagnostics zip that is safe to attach to bug
13+reports. It combines sanitized Gateway status, health, logs, config shape, and
14+recent payload-free stability events.
15+16+## Quick start
17+18+```bash
19+openclaw gateway diagnostics export
20+```
21+22+The command prints the written zip path. To choose a path:
23+24+```bash
25+openclaw gateway diagnostics export --output openclaw-diagnostics.zip
26+```
27+28+For automation:
29+30+```bash
31+openclaw gateway diagnostics export --json
32+```
33+34+## What the export contains
35+36+The zip includes:
37+38+- `summary.md`: human-readable overview for support.
39+- `diagnostics.json`: machine-readable summary of config, logs, status, health,
40+ and stability data.
41+- `manifest.json`: export metadata and file list.
42+- Sanitized config shape and non-secret config details.
43+- Sanitized log summaries and recent redacted log lines.
44+- Best-effort Gateway status and health snapshots.
45+- `stability/latest.json`: newest persisted stability bundle, when available.
46+47+The export is useful even when the Gateway is unhealthy. If the Gateway cannot
48+answer status or health requests, the local logs, config shape, and latest
49+stability bundle are still collected when available.
50+51+## Privacy model
52+53+Diagnostics are designed to be shareable. The export keeps operational data
54+that helps debugging, such as:
55+56+- subsystem names, plugin ids, provider ids, channel ids, and configured modes
57+- status codes, durations, byte counts, queue state, and memory readings
58+- sanitized log metadata and redacted operational messages
59+- config shape and non-secret feature settings
60+61+The export omits or redacts:
62+63+- chat text, prompts, instructions, webhook bodies, and tool outputs
64+- credentials, API keys, tokens, cookies, and secret values
65+- raw request or response bodies
66+- account ids, message ids, raw session ids, hostnames, and local usernames
67+68+When a log message looks like user, chat, prompt, or tool payload text, the
69+export keeps only that a message was omitted and the byte count.
70+71+## Stability recorder
72+73+The Gateway records a bounded, payload-free stability stream by default when
74+diagnostics are enabled. It is for operational facts, not content.
75+76+Inspect the live recorder:
77+78+```bash
79+openclaw gateway stability
80+openclaw gateway stability --type payload.large
81+openclaw gateway stability --json
82+```
83+84+Inspect the newest persisted stability bundle after a fatal exit, shutdown
85+timeout, or restart startup failure:
86+87+```bash
88+openclaw gateway stability --bundle latest
89+```
90+91+Create a diagnostics zip from the newest persisted bundle:
92+93+```bash
94+openclaw gateway stability --bundle latest --export
95+```
96+97+Persisted bundles live under `~/.openclaw/logs/stability/` when events exist.
98+99+## Useful options
100+101+```bash
102+openclaw gateway diagnostics export \
103+ --output openclaw-diagnostics.zip \
104+ --log-lines 5000 \
105+ --log-bytes 1000000
106+```
107+108+- `--output <path>`: write to a specific zip path.
109+- `--log-lines <count>`: maximum sanitized log lines to include.
110+- `--log-bytes <bytes>`: maximum log bytes to inspect.
111+- `--url <url>`: Gateway WebSocket URL for status and health snapshots.
112+- `--token <token>`: Gateway token for status and health snapshots.
113+- `--password <password>`: Gateway password for status and health snapshots.
114+- `--timeout <ms>`: status and health snapshot timeout.
115+- `--no-stability-bundle`: skip persisted stability bundle lookup.
116+- `--json`: print machine-readable export metadata.
117+118+## Disable diagnostics
119+120+Diagnostics are enabled by default. To disable the stability recorder and
121+diagnostic event collection:
122+123+```json5
124+{
125+ diagnostics: {
126+ enabled: false,
127+ },
128+}
129+```
130+131+Disabling diagnostics reduces bug-report detail. It does not affect normal
132+Gateway logging.
133+134+## Related docs
135+136+- [Health Checks](/gateway/health)
137+- [Gateway CLI](/cli/gateway#gateway-diagnostics-export)
138+- [Gateway Protocol](/gateway/protocol#system-and-identity)
139+- [Logging](/logging)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。