Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle RabbitMQ Logs?

We're running RabbitMQ and the .log it's writing to the log folder get quiet large.

What's the right thing to do there, can we just delete it from time to time, should we rotate them away and then delete them? I fail to find any documentation on this.

like image 236
Razze Avatar asked Jan 17 '17 12:01

Razze


People also ask

How do I access RabbitMQ logs?

RabbitMQ Debian and RPM packages will set up logrotate to run weekly on files located in default /var/log/rabbitmq directory. Rotation configuration can be found in /etc/logrotate. d/rabbitmq-server.

How do I delete RabbitMQ logs?

RabbitMQ nodes do not use old log files so if you are sure you don't need them, feel free to delete or archive them. Using the cmd #rabbitmqctl rotate_logs . 1 allows you to remove the currently used log file, however i need to remove all older logs in the same directoy.


2 Answers

Rotating the logs is pretty much the only thing you can do you can use the rotate scheduler to keep them under control.

rabbitmqctl rotate_logs

If you are looking for a different alternative to the plain old log file in rabbitmq, Sematext.com has an excellent log aggregator service that will store, filter, and manage your logs.

like image 118
John Demian Avatar answered Oct 01 '22 23:10

John Demian


You can use rabbitmqctl rotate_logs

Instruct the RabbitMQ node to rotate the log files.

then delete the OLD files

like image 43
Gabriele Santomaggio Avatar answered Oct 02 '22 00:10

Gabriele Santomaggio