Skip to content

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):

bash
# Linux / macOS
rabbitmq-diagnostics -q log_location

# Windows (PowerShell / cmd)
rabbitmq-diagnostics.bat -q log_location

Other commands you will reach for immediately:

bash
# 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-0

RabbitMQ Default Log Locations by Platform ​

Default paths follow RabbitMQ's RABBITMQ_LOG_BASE and RABBITMQ_LOGS conventions:

Platform / Install MethodDefault Log LocationHow to View
Debian / Ubuntu (deb) & RHEL / CentOS (rpm)/var/log/rabbitmq/$RABBITMQ_NODENAME.logtail -f /var/log/rabbitmq/rabbit@*.log
macOS (Homebrew, Apple Silicon)/opt/homebrew/var/log/rabbitmq/$RABBITMQ_NODENAME.logtail -f /opt/homebrew/var/log/rabbitmq/*.log
Generic UNIX Binary$RABBITMQ_HOME/var/log/rabbitmq/$RABBITMQ_NODENAME.logtail -f $RABBITMQ_HOME/var/log/rabbitmq/*.log
Windows%APPDATA%\RabbitMQ\log\%RABBITMQ_NODENAME%.logGet-Content "$env:APPDATA\RabbitMQ\log\*.log" -Wait
Docker (official image)Standard output (RABBITMQ_LOGS=-)docker logs -f <container>
Kubernetes Cluster OperatorContainer stdout on broker podskubectl logs <instance>-server-0 or kubectl rabbitmq tail <instance>

To inspect the RabbitMQ Cluster Kubernetes Operator controller logs themselves (reconciliation errors, StatefulSet updates):

bash
kubectl -n rabbitmq-system logs -l app.kubernetes.io/name=rabbitmq-cluster-operator

Important RABBITMQ_LOGS precedence rule: If the RABBITMQ_LOGS environment variable is set (to a file path or -), it takes precedence over rabbitmq.conf and causes logging-related settings in rabbitmq.conf to be ignored. In production, prefer configuring logging in rabbitmq.conf rather than via RABBITMQ_LOGS.


Log Levels and Categories in rabbitmq.conf ​

RabbitMQ uses six strictly ordered log levels. The default level is info.

Log LevelVerbositySeverity
debugMost verboseLowest severity
infoDefaultInformational events
warningModerateRecoverable issues, failed logins
errorLowErrors affecting operations
criticalVery lowHighest severity
noneDisabledNot 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:

ini
# 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 = info

Set 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:

CategoryWhat It Logs
connectionConnection lifecycle events for AMQP 0-9-1, AMQP 1.0, MQTT, and STOMP
channelChannel logs (mostly errors and warnings on AMQP 0-9-1 channels)
queueQueue logs (mostly debug messages)
federationFederation plugin events
upgradeVerbose upgrade logs (can be noisy)
userAuthentication events (successful logins at info, failed logins at warning)
defaultAll 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:

ini
log.default.level = warning
log.connection.level = info
log.user.level = info
log.user.file = auth.log

Changing Log Level Without Restarting ​

Use rabbitmqctl set_log_level to change the effective log level on a running node:

bash
# 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 info

This 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.

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):

ini
log.file.rotation.size = 10485760
log.file.rotation.count = 5
log.file.rotation.compress = true

Periodic rotation (rotate daily at midnight $D0, or at 23:00 with $D23):

ini
log.file.rotation.date = $D0
log.file.rotation.count = 5
log.file.rotation.compress = true
Config KeyPurposeExample
log.file.rotation.sizeMax file size in bytes before rotating (cannot combine with date)10485760 (10 MiB)
log.file.rotation.datePeriodic rotation schedule (cannot combine with size)$D0 (midnight), $D23 (23:00)
log.file.rotation.countNumber of archived log files to retain5
log.file.rotation.compressCompress rotated log filestrue

Docker Logs and JSON Log Format ​

In Docker, RabbitMQ writes to stdout so docker logs captures everything automatically:

bash
# Last 200 lines with timestamps
docker logs --tail 200 --timestamps rabbitmq

# Follow live logs from the last 10 minutes
docker logs -f --since 10m rabbitmq

Enabling 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:

ini
# For file logging
log.file.formatter = json

# For console / Docker / Kubernetes stdout logging
log.console = true
log.console.formatter = json

You 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:

bash
# macOS
brew install logdy

# Linux / macOS
curl https://logdy.dev/install.sh | sh

Stream RabbitMQ logs from any source:

bash
# 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 | logdy

Logdy 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.