Overview
Rousseau uses Go's standard library log/slog for all structured logging. The log.* block picks the level and format; concrete handler construction lives in internal/cli/root.go:newLogger.
Logs go to stderr by default. rousseau mcp requires this because stdout is reserved for the JSON-RPC transport.
log.*
| Field | Type | Default | Required | Description | Source |
|---|---|---|---|---|---|
log.level |
string | info |
no | One of debug, info, warn, warning, error. Case-insensitive. Unknown values fall back to info. |
LogConfig.Level in internal/config/config.go; parsed by newLogger |
log.format |
string | text |
no | text = slog.TextHandler, json = slog.JSONHandler. Anything else defaults to text. |
LogConfig.Format |
Level semantics
Every request/response, every tool-call, every whatsmeow protocol frame. Use in development only — extremely verbose.
One-liner per meaningful event: session created, transport connected, cron fired, provider called. Recommended for production.
Recoverable anomalies: rate limits, retries, expired auth tokens.
Non-recoverable per-request failures. Structured errors with attributes like err, event, session_id, sender.
Log formats
text— human-friendlykey=valuepairs. Good forjournalctl -fon a workstation.json— one JSON object per line. Ship to Loki, Datadog, ELK, or any log aggregator with a JSON parser. Recommended in production.
Standard log-event names
Rousseau uses dot-separated event names as the msg field:
| Prefix | Emitted by |
|---|---|
whatsapp.* |
internal/transport/whatsapp/ |
signal.* |
internal/transport/signal/ |
telegram.* |
internal/transport/telegram/ |
matrix.* |
internal/transport/matrix/ |
slack.* |
internal/transport/slack/ |
discord.* |
internal/transport/discord/ |
email.* |
internal/transport/email/ |
sms.* |
internal/transport/sms/ |
imessage.* |
internal/transport/imessage/ |
router.transport.* |
internal/transport/router.go |
agent.* |
internal/agent/ |
cron.* |
internal/cron/ |
mcp.* |
internal/mcp/ |
See Reference: Logs for the full event catalogue.
Whatsmeow log-level mapping
The whatsmeow library needs its own log level; rousseau translates from log.level via whatsappLogLevel in internal/cli/whatsapp.go:
log.level |
Whatsmeow level |
|---|---|
debug |
DEBUG |
info (default) |
INFO |
warn, warning |
WARN |
error |
ERROR |
Environment variables
| Variable | Effect |
|---|---|
ROUSSEAU_LOG_LEVEL |
Overrides log.level. |
ROUSSEAU_LOG_FORMAT |
Overrides log.format. |
Worked examples
# Development
log:
level: debug
format: text
# Production (containerised)
log:
level: info
format: json
# One-off debug run without touching the config file
ROUSSEAU_LOG_LEVEL=debug ROUSSEAU_LOG_FORMAT=text rousseau whatsapp 2>debug.log
Related pages
- Reference: Logs — the event catalogue.
- Best Practices: Cost control — logs feed cost dashboards.
- Deployment — journalctl + Quadlet.
- Reference: Config: State