RabbitMQ Logs: Location, Log Level, Rotation & JSON Format β
When a RabbitMQ node drops connections or refuses publishes, you want the exact log file path and the right rabbitmqctl command immediately. This reference covers default log locations across platforms, live and persistent log-level changes, log rotation, JSON formatting, and viewing RabbitMQ logs in a browser UI with Logdy.
Quick Commands: Find and Inspect RabbitMQ Logs Now β
Run this on any RabbitMQ node to print its active log file path (or - when logging to stdout):
# Linux / macOS
rabbitmq-diagnostics -q log_location
# Windows (PowerShell / cmd)
rabbitmq-diagnostics.bat -q log_locationOther commands you will reach for immediately:
# Tail the last 300 lines from a running node (useful over remote CLI)
rabbitmq-diagnostics -n rabbit@target-host log_tail -N 300
# Stream live log lines from a running node
rabbitmq-diagnostics -n rabbit@target-host log_tail_stream
# Temporarily switch a running node to debug logging (resets on restart)
rabbitmqctl set_log_level debug
# Docker container logs
docker logs -f --tail 100 rabbitmq
# Kubernetes Cluster Operator pod logs
kubectl logs -f <instance>-server-0RabbitMQ Default Log Locations by Platform β
Default paths follow RabbitMQ's RABBITMQ_LOG_BASE and RABBITMQ_LOGS conventions:
| Platform / Install Method | Default Log Location | How to View |
|---|---|---|
Debian / Ubuntu (deb) & RHEL / CentOS (rpm) | /var/log/rabbitmq/$RABBITMQ_NODENAME.log | tail -f /var/log/rabbitmq/rabbit@*.log |
| macOS (Homebrew, Apple Silicon) | /opt/homebrew/var/log/rabbitmq/$RABBITMQ_NODENAME.log | tail -f /opt/homebrew/var/log/rabbitmq/*.log |
| Generic UNIX Binary | $RABBITMQ_HOME/var/log/rabbitmq/$RABBITMQ_NODENAME.log | tail -f $RABBITMQ_HOME/var/log/rabbitmq/*.log |
| Windows | %APPDATA%\RabbitMQ\log\%RABBITMQ_NODENAME%.log | Get-Content "$env:APPDATA\RabbitMQ\log\*.log" -Wait |
| Docker (official image) | Standard output (RABBITMQ_LOGS=-) | docker logs -f <container> |
| Kubernetes Cluster Operator | Container stdout on broker pods | kubectl logs <instance>-server-0 or kubectl rabbitmq tail <instance> |
To inspect the RabbitMQ Cluster Kubernetes Operator controller logs themselves (reconciliation errors, StatefulSet updates):
kubectl -n rabbitmq-system logs -l app.kubernetes.io/name=rabbitmq-cluster-operatorImportant
RABBITMQ_LOGSprecedence rule: If theRABBITMQ_LOGSenvironment variable is set (to a file path or-), it takes precedence overrabbitmq.confand causes logging-related settings inrabbitmq.confto be ignored. In production, prefer configuring logging inrabbitmq.confrather than viaRABBITMQ_LOGS.
Log Levels and Categories in rabbitmq.conf β
RabbitMQ uses six strictly ordered log levels. The default level is info.
| Log Level | Verbosity | Severity |
|---|---|---|
debug | Most verbose | Lowest severity |
info | Default | Informational events |
warning | Moderate | Recoverable issues, failed logins |
error | Low | Errors affecting operations |
critical | Very low | Highest severity |
none | Disabled | Not applicable (turns logging off) |
Configuring File and Console Outputs β
In rabbitmq.conf (commonly /etc/rabbitmq/rabbitmq.conf on Linux or %APPDATA%\RabbitMQ\rabbitmq.conf on Windows), configure file and/or console outputs independently:
# File output
log.file = /var/log/rabbitmq/rabbit.log
log.file.level = info
# Console (stdout) output β disabled by default
log.console = true
log.console.level = infoSet log.file = false if you only want stdout logging (for example, in containers managed by Docker or Kubernetes).
Filtering by Log Message Category β
RabbitMQ groups log entries into categories so you can raise verbosity on one subsystem without flooding disk with debug output from everything else:
| Category | What It Logs |
|---|---|
connection | Connection lifecycle events for AMQP 0-9-1, AMQP 1.0, MQTT, and STOMP |
channel | Channel logs (mostly errors and warnings on AMQP 0-9-1 channels) |
queue | Queue logs (mostly debug messages) |
federation | Federation plugin events |
upgrade | Verbose upgrade logs (can be noisy) |
user | Authentication events (successful logins at info, failed logins at warning) |
default | All other log entries (file location cannot be overridden for default) |
Example: keep general logs at warning, log connection events at info, and route user authentication events to a separate file:
log.default.level = warning
log.connection.level = info
log.user.level = info
log.user.file = auth.logChanging Log Level Without Restarting β
Use rabbitmqctl set_log_level to change the effective log level on a running node:
# Local node
rabbitmqctl set_log_level debug
# Remote or named node
rabbitmqctl -n rabbit@target-host set_log_level debug
# Return to normal verbosity
rabbitmqctl set_log_level infoThis change is transientβit resets to the level defined in rabbitmq.conf after a node restart.
RabbitMQ Log Rotation β
RabbitMQ always appends to its log files and does not rotate logs by default. You have two options: OS logrotate (recommended on Linux) or RabbitMQ's built-in rotation settings.
Option 1: OS logrotate (Recommended on Linux) β
Official Debian and RPM packages install a logrotate policy automatically. On custom Linux setups, use logrotate against /var/log/rabbitmq/*.log and keep built-in rotation disabled.
Option 2: Built-in Rotation in rabbitmq.conf β
RabbitMQ supports either size-based or time-based (periodic) rotation. Note that log.file.rotation.size and log.file.rotation.date are mutually exclusiveβdo not set both together.
Size-based rotation (rotate at 10 MiB, keep 5 compressed archives):
log.file.rotation.size = 10485760
log.file.rotation.count = 5
log.file.rotation.compress = truePeriodic rotation (rotate daily at midnight $D0, or at 23:00 with $D23):
log.file.rotation.date = $D0
log.file.rotation.count = 5
log.file.rotation.compress = true| Config Key | Purpose | Example |
|---|---|---|
log.file.rotation.size | Max file size in bytes before rotating (cannot combine with date) | 10485760 (10 MiB) |
log.file.rotation.date | Periodic rotation schedule (cannot combine with size) | $D0 (midnight), $D23 (23:00) |
log.file.rotation.count | Number of archived log files to retain | 5 |
log.file.rotation.compress | Compress rotated log files | true |
Docker Logs and JSON Log Format β
In Docker, RabbitMQ writes to stdout so docker logs captures everything automatically:
# Last 200 lines with timestamps
docker logs --tail 200 --timestamps rabbitmq
# Follow live logs from the last 10 minutes
docker logs -f --since 10m rabbitmqEnabling JSON Log Format β
Structured JSON logs make filtering by level, timestamp, or message fields far easier than parsing multiline plain-text Erlang logs. Enable the JSON formatter in rabbitmq.conf:
# For file logging
log.file.formatter = json
# For console / Docker / Kubernetes stdout logging
log.console = true
log.console.formatter = jsonYou can also control timestamp formatting with log.file.formatter.time_format or log.console.formatter.time_format.
View RabbitMQ Logs Live in a Browser UI with Logdy β
Once you have located your RabbitMQ log file or container stream, piping it into Logdy turns raw lines into a local searchable table at http://127.0.0.1:8080βwith automatic columns and click-to-filter facets when JSON formatting is enabled.
Install Logdy:
# macOS
brew install logdy
# Linux / macOS
curl https://logdy.dev/install.sh | shStream RabbitMQ logs from any source:
# Follow a Linux log file (use --full-read to load existing lines first)
logdy follow /var/log/rabbitmq/[email protected] --full-read
# Stream from Docker (add --fallthrough to also print lines in your terminal)
docker logs -f rabbitmq 2>&1 | logdy --fallthrough
# Stream from Kubernetes Cluster Operator pod
kubectl logs -f hello-world-server-0 | logdy
# Stream remotely via rabbitmq-diagnostics
rabbitmq-diagnostics -n rabbit@target-host log_tail_stream | logdyLogdy binds to 127.0.0.1:8080 by default and keeps your log data local in memory (up to --max-message-count, default 100000). Pass --no-analytics --no-updates (-n -u) if you want to disable anonymous telemetry and update checks.
For a full walkthrough of configuring columns and parsers specifically for RabbitMQ, see RabbitMQ Logs Viewer: Setup a Web UI for Logging.
Frequently Asked Questions β
Why is RabbitMQ ignoring my rabbitmq.conf logging settings? β
Check whether the RABBITMQ_LOGS environment variable is set in your shell, systemd unit, or container spec. RabbitMQ's official docs note that when RABBITMQ_LOGS is set, logging-related settings in rabbitmq.conf are effectively ignored.
Can I change the RabbitMQ log level without restarting the broker? β
Yes. Run rabbitmqctl set_log_level debug (or info, warning, error, critical, none). The change takes effect immediately but does not persist across a node restartβupdate rabbitmq.conf for permanent changes.
Can I use log.file.rotation.size and log.file.rotation.date together? β
No. RabbitMQ treats size-based and date-based built-in rotation as mutually exclusive. Pick one, or leave both unset and let Linux logrotate manage /var/log/rabbitmq/*.log.
How do I view RabbitMQ logs in Kubernetes? β
Run kubectl logs <instance>-server-0 (add -f to follow) for broker logs, or kubectl rabbitmq tail <instance> if you have the kubectl rabbitmq plugin installed. For operator reconciliation logs, run kubectl -n rabbitmq-system logs -l app.kubernetes.io/name=rabbitmq-cluster-operator.
