# Logging and debugging

> Where logs are, service start and restart, and what to check when replies never arrive

- 网址：https://funcoding.ai/agents/openclaw/help/faq/logging-and-debugging/
- 来源：OpenClaw 官方文档原文（英文），MIT 许可，同步于 2026-10-11
- 官方原文：https://docs.openclaw.ai/zh-CN/help/faq/logging-and-debugging

---
## Logging and debugging

<details>
<summary>Where are logs?</summary>

File logs (structured): `/tmp/openclaw/openclaw-YYYY-MM-DD.log` for the default profile, or `/tmp/openclaw/openclaw-<profile>-YYYY-MM-DD.log` for a named profile. Set a stable path via `logging.file`; file log level via `logging.level`; console verbosity via `--verbose` and `logging.consoleLevel`.

Fastest tail:

```bash
openclaw logs --follow
```

Service/supervisor logs (when the gateway runs via launchd/systemd):

- macOS launchd stdout and stderr: `~/Library/Logs/openclaw/gateway.log` (profiles use `gateway-<profile>.log`; both streams share this file, so startup failures that happen before the logger starts are recorded here too).
- Linux: `journalctl --user -u openclaw-gateway[-<profile>].service -n 200 --no-pager`.
- Windows: `schtasks /Query /TN "OpenClaw Gateway (<profile>)" /V /FO LIST`.

See [Troubleshooting](https://funcoding.ai/agents/openclaw/gateway/troubleshooting/) for more.

</details>

<details>
<summary>How do I start/stop/restart the Gateway service?</summary>

```bash
openclaw gateway status
openclaw gateway restart
```

If you run the gateway manually, `openclaw gateway --force` can reclaim the port. See [Gateway](https://funcoding.ai/agents/openclaw/gateway/).

</details>

<details>
<summary>I closed my terminal on Windows - how do I restart OpenClaw?</summary>

Three Windows install modes:

**1) Windows Hub local setup**: the native app manages a local app-owned WSL Gateway. Open **OpenClaw Companion** from the Start menu or tray, then use **Gateway Setup** or the Connections tab.

**2) Manual WSL2 Gateway**: the Gateway runs inside Linux.
```powershell
wsl
openclaw gateway status
openclaw gateway restart
```
If you never installed the service, start it in the foreground: `openclaw gateway run`.

**3) Native Windows CLI/Gateway**: runs directly in Windows.
```powershell
openclaw gateway status
openclaw gateway restart
```
If you run it manually (no service): `openclaw gateway run`.

Docs: [Windows](https://funcoding.ai/agents/openclaw/platforms/windows/), [Gateway service runbook](https://funcoding.ai/agents/openclaw/gateway/).

</details>

<details>
<summary>The Gateway is up but replies never arrive. What should I check?</summary>

Quick health sweep:

```bash
openclaw status
openclaw models status
openclaw channels status
openclaw logs --follow
```

Common causes: model auth not loaded on the **gateway host** (check `models status`), channel pairing/allowlist blocking replies (check channel config and logs), or WebChat/Dashboard open without the right token. If remote, confirm the tunnel/Tailscale connection is up and the Gateway WebSocket is reachable.

Docs: [Channels](https://funcoding.ai/agents/openclaw/channels/), [Troubleshooting](https://funcoding.ai/agents/openclaw/gateway/troubleshooting/), [Remote access](https://funcoding.ai/agents/openclaw/gateway/remote/).

</details>

<details>
<summary>"Disconnected from gateway: no reason" - what now?</summary>

Usually means the UI lost the WebSocket connection. Check: is the Gateway running (`openclaw gateway status`)? Is it healthy (`openclaw status`)? Does the UI have the right token (`openclaw dashboard`)? If remote, is the tunnel/Tailscale link up?

Then tail logs:

```bash
openclaw logs --follow
```

Docs: [Dashboard](https://funcoding.ai/agents/openclaw/web/dashboard/), [Remote access](https://funcoding.ai/agents/openclaw/gateway/remote/), [Troubleshooting](https://funcoding.ai/agents/openclaw/gateway/troubleshooting/).

</details>

<details>
<summary>Telegram setMyCommands fails. What should I check?</summary>

```bash
openclaw channels status
openclaw channels logs --channel telegram
```

Then match the error:

- `BOT_COMMANDS_TOO_MUCH`: the Telegram menu has too many entries. OpenClaw already trims to the Telegram limit and retries with fewer commands, but some menu entries may still be dropped. Reduce plugin/skill/custom commands, or disable `channels.telegram.commands.native` if you do not need the menu.
- `TypeError: fetch failed`, `Network request for 'setMyCommands' failed!`, or similar network errors: on a VPS or behind a proxy, confirm outbound HTTPS is allowed and DNS works for `api.telegram.org`.

If the Gateway is remote, check logs on the Gateway host.

Docs: [Telegram](https://funcoding.ai/agents/openclaw/channels/telegram/), [Channel troubleshooting](https://funcoding.ai/agents/openclaw/channels/troubleshooting/).

</details>

<details>
<summary>TUI shows no output. What should I check?</summary>

```bash
openclaw status
openclaw models status
openclaw logs --follow
```

In the TUI, use `/status` to see the current state. If you expect replies in a chat channel, confirm delivery is enabled (`/deliver on`).

Docs: [TUI](https://funcoding.ai/agents/openclaw/web/tui/), [Slash commands](https://funcoding.ai/agents/openclaw/tools/slash-commands/).

</details>

<details>
<summary>How do I completely stop then start the Gateway?</summary>

If you installed the service (launchd on macOS, systemd on Linux):

```bash
openclaw gateway stop
openclaw gateway start
```

In the foreground, stop with Ctrl-C, then `openclaw gateway run`.

Docs: [Gateway service runbook](https://funcoding.ai/agents/openclaw/gateway/).

</details>

<details>
<summary>ELI5: openclaw gateway restart vs openclaw gateway</summary>

`openclaw gateway restart` restarts the **background service** (launchd/systemd). `openclaw gateway` runs the gateway **in the foreground** for this terminal session. Use the gateway subcommands if you installed the service; use the bare foreground run for a one-off.

</details>

<details>
<summary>Fastest way to get more details when something fails</summary>

Start the Gateway with `--verbose` for more console detail, then inspect the log file for channel auth, model routing, and RPC errors.

</details>
