[rabbitmq-discuss] RabbitMQ log files rotation daily
Ask Solem
ask at rabbitmq.com
Wed Feb 1 14:23:37 GMT 2012
On 1 Feb 2012, at 03:44, Roshan Pradeep wrote:
> Hi All
>
> I want to rotate the RabbitMQ log files in daily basis like support in log4j. The only log rotate support I found is rabbitmqctl rotate_logs <suffix>.
From http://manpages.ubuntu.com/manpages/jaunty/man1/rabbitmqctl.1.html:
rotate_logs [suffix]
instruct the RabbitMQ node to rotate the log files. The RabbitMQ
broker will attempt to append the current contents of the log file
to the file with the name composed of the original name and the
suffix. It will create a new file if such a file does not already
exist. When no suffix is specified, the empty log file is
simply created at the original location; no rotation takes place.
When an error occurs while appending the contents of the old log
file, the operation behaves in the same way as if no suffix was
specified. This command might be helpful when you are e.g. writing
your own logrotate script and you do not want to restart the
RabbitMQ node.
>
> Could some one please explain how to achieve the daily log file rotation. Also I am not sure what kind of suffix expect from rabbitmqctl rotate_logs.
>
Have you tried adding rotate_logs to the daily cron script?
More information about the rabbitmq-discuss
mailing list