[rabbitmq-discuss] log file management

Michael Ossareh michael at heysan.com
Wed Dec 10 03:06:34 GMT 2008


Hi,

Today I just restarted our rabbitmq server due to what seems to be a
memory leak somwhere in rabbitmq. We'll investigate that more; however
I noticed

rabbitmq-server/scripts/rabbitmq-server

has two bad lines in it;

[ -f  "${LOGS}" ] && cat "${LOGS}" >> "${LOGS}${BACKUP_EXTENSION}"
[ -f  "${SASL_LOGS}" ] && cat "${SASL_LOGS}" >>
"${SASL_LOGS}${BACKUP_EXTENSION}"

in our case we have many gb log files (7gb after a few days)  and the
server spends a long time putting them into cat.

I suggest changing it to

[ -f  "${LOGS}" ] && mv "${LOGS}" >> "${LOGS}${BACKUP_EXTENSION}" &&
touch "${LOGS}" && chown ${RMQUSER}.${RMQGRP} "${LOGS}"
[ -f  "${SASL_LOGS}" ] && mv "${SASL_LOGS}" >>
"${SASL_LOGS}${BACKUP_EXTENSION}" && touch "${SASL_LOGS}" && chown
${RMQUSER}.${RMQGRP} "${SASL_LOGS}"

or something like that.

Overall, however, surely log rotation is the task of logrotated? I'm
not sure how well this maps to any erlang best practices though.

More than happy to help make whatever changes are needed, but will
need some guidance.

Thanks,

mike
-- 
god loves atheists, Fact: http://www.mrwiggleslovesyou.com/comics/rehab477.jpg




More information about the rabbitmq-discuss mailing list