Best way to rotate rabbitmq log files

My bunny magazines are getting really big and I wonder if there is a better way to control the rotation. I would like magazines to rotate based on size and store no more than ten magazines at a time. The best I've found so far is that you can turn off logging by placing SERVER_START_ARGS="-kernel error_logger silent" in the rabbitmq.conf file. Is there a better way? I would like to avoid using crontab for this.

+8
source share
5 answers

The best way to do this is to upgrade to RabbitMQ 2.4.1. Many people still use the very old and outdated RabbitMQ software, which has problems with large save logs. Newer versions handle this much better, and they also have a control plugin (accessible over the Internet) and much faster message routing.

Ideally, you should upgrade to Erlang R14B02 first and then upgrade RabbitMQ.

Skip Erlang R14B03 if you intend to compile RabbitMQ from source.

+3
source

You can use this command.

 rabbitmqctl rotate_logs 

He works for me. Read more at http://www.rabbitmq.com/configure.html

Hope this helps you.

+6
source

The best choice is that the log rotates logically inside your rabbitmq.conf file, as shown below:

 {log, [ {file, [{file, "/var/log/rabbitmq/rabbitmq.log"}, %% log.file {level, info}, %% log.file.info {date, "$D0"}, %% log.file.rotation.date {size, 1024}, %% log.file.rotation.size {count, 15} %% log.file.rotation.count ]} ]}, 
+4
source

I think the best way is to use a configuration file. I tried the above methods, but they did not help me. I used the following configuration here and it worked:

  {lager, [ {handlers, [ {lager_file_backend, [{file, "rabbit.log"}, {level, info}, {date, "$D0"}, {size, 10}, {count, 2} ]}]} ]}, 

You can find information on what date, size and quantity does in this link https://github.com/basho/lager

0
source

rabbitmqctl rotate_logs
It works on RabbitMQ 3.6.10, but does not work on RabbitMQ version 3.7.12. Do I need to add any other settings along with the above command on RabbitMQ 3.7.12 to rotate the log manually?

0
source

Source: https://habr.com/ru/post/890424/


All Articles