openclaw - 💡(How to fix) Fix RFE: expose WhatsApp/Baileys channel log level via openclaw.json (e.g., channels.whatsapp.logLevel) to suppress designed-and-benign reconnect lifecycle logs [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71533Fetched 2026-04-26 05:11:46
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

accepts any object that implements trace/debug/info/warn/error/child methods.) behavior); allow error for quiet ops logs. log path — a single error-level cutoff suppresses them as a class.

Fix Action

Fix / Workaround

Workaround in use

Code Example

[whatsapp] Web connection closed (status 499). Retry 1/12 in 2.13s… (status=499)
[whatsapp] Web connection closed (status 428). Retry 1/12 in 2.05s… (status=428 Precondition Required Connection Terminated)
[whatsapp] Web connection closed (status 503). Retry 1/12 in 2.0s… (status=503 Service Unavailable Stream Errored (unknown))
[whatsapp] No messages received in 30m - restarting connection

---

const waLogLevel = config.channels?.whatsapp?.logLevel ?? 'info';
const sock = makeWASocket({
    // ...existing options...
    logger: pino({ level: waLogLevel }),
});
RAW_BUFFERClick to expand / collapse

Observed

gateway.err.log emits frequent lifecycle reconnect entries from the bundled WhatsApp client:

[whatsapp] Web connection closed (status 499). Retry 1/12 in 2.13s… (status=499)
[whatsapp] Web connection closed (status 428). Retry 1/12 in 2.05s… (status=428 Precondition Required Connection Terminated)
[whatsapp] Web connection closed (status 503). Retry 1/12 in 2.0s… (status=503 Service Unavailable Stream Errored (unknown))
[whatsapp] No messages received in 30m - restarting connection

Source: bundled @whiskeysockets/baileys 7.0.0-rc.9 lifecycle logging. Reconnects are designed Baileys/WhatsApp Web behavior; the library auto-recovers and inbound message flow remains uninterrupted (verified via downstream activity_event row counts in our deployment).

These dominate gateway.err.log (>200 entries in 48h on a healthy install) and obscure real signals.

Where the knob would land

In the bundled gateway, the makeWASocket(...) call site passes lifecycle options. makeWASocket accepts a logger: ILogger field (any pino-compatible logger), so:

const waLogLevel = config.channels?.whatsapp?.logLevel ?? 'info';
const sock = makeWASocket({
    // ...existing options...
    logger: pino({ level: waLogLevel }),
});

(Or a minimal pino-shape no-op logger if pino isn't already a dep — Baileys accepts any object that implements trace/debug/info/warn/error/child methods.)

Today there is no openclaw.json passthrough — the call site is in upstream bundled JS and doesn't read from config.

Proposed

openclaw.json should accept channels.whatsapp.logLevel (or channels.whatsapp.baileys.logLevel) and pipe it to the Baileys logger constructor at the makeWASocket call site. Default info (current effective behavior); allow error for quiet ops logs.

Versions

  • openclaw: 2026.4.5
  • @whiskeysockets/baileys: 7.0.0-rc.9

Workaround in use

Same operator-side wrapper-script log-filter daemon as our companion Slack RFE. Strips the four designed-and-benign reconnect patterns (3 WhatsApp status codes + 30m-no-messages restart) into a parallel gateway.err.clean.log. Works, but should not be necessary if the upstream config knob existed.

Notes for the implementer

  • Baileys logger is required in the type, but accepting level: 'silent' on the pino instance is the cleanest universal mute — no need to introduce conditional logic at the call site.
  • If pino is not already a transitive dep of openclaw, a 50-line pino-shape no-op (or level: 'silent') shim works equally well and avoids adding a new dep.
  • The WhatsApp 3-digit status codes (499/428/503/408) all come from the same log path — a single error-level cutoff suppresses them as a class.

extent analysis

TL;DR

Implement a configurable log level for the WhatsApp client in openclaw.json to reduce noise in gateway.err.log.

Guidance

  • Add a logLevel option to openclaw.json under channels.whatsapp to control the logging level of the WhatsApp client.
  • Update the makeWASocket call site to pass the configured log level to the Baileys logger constructor.
  • Consider using a level: 'silent' pino instance or a no-op logger shim if pino is not already a dependency.
  • Set the default log level to info to maintain current behavior, and allow error for quieter logs.

Example

const waLogLevel = config.channels?.whatsapp?.logLevel ?? 'info';
const sock = makeWASocket({
    // ...existing options...
    logger: pino({ level: waLogLevel }),
});

Notes

  • The proposed solution aims to reduce log noise by allowing operators to configure the log level for the WhatsApp client.
  • The workaround currently in use can be replaced by the proposed solution once implemented.

Recommendation

Apply the proposed solution by adding a configurable log level to openclaw.json and updating the makeWASocket call site to use the configured log level, as this will provide a more elegant and maintainable solution than the current workaround.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix RFE: expose WhatsApp/Baileys channel log level via openclaw.json (e.g., channels.whatsapp.logLevel) to suppress designed-and-benign reconnect lifecycle logs [1 participants]