Monitoring
Write JSON logs
Make the bot write machine readable log lines for log tools such as Loki.
This page is for people who collect logs with a tool. You can skip it otherwise.
Turn JSON logs on
Add this line to the bot config.json:
"logFormat": "json"
The bot then writes one JSON object per line instead of the colored window output.
Fields
| Field | Meaning |
|---|---|
time | Time of the message in UTC. |
level | info, warn, error, success or debug. |
module | The part of the bot that wrote it, for example bot, mute, metrics, telemetry or updates. |
process | gateway, or cluster-0, cluster-1 and so on. |
msg | The message. Tokens and secrets are hidden. |
error | Only present when there is extra detail or an error. Secrets are hidden here too. |