Rabbitmq: How to rotate the rabbitmq log file
search cancel

Rabbitmq: How to rotate the rabbitmq log file

book

Article ID: 387723

calendar_today

Updated On: 02-07-2025

Products

VMware RabbitMQ VMware Tanzu RabbitMQ Pivotal RabbitMQ

Issue/Introduction

Normally, the Rabbitmq log will only have one log and it will append the new logs to this file. But you can use the logrotate to rotate this log to different files.

Resolution

This guide will show you how to implement it.

 

  • Edit this rabbitmq.conf and add the following lines:
# rotate when the file reaches 10K
log.file.rotation.size = 10000

# keep up to 10 archived log files in addition to the current one
log.file.rotation.count = 10
 
  • Restart the rabbitmq service
  • You will see the log file is rotated
 
 
 
Please check the following documentation for more details.