[rabbitmq-discuss] Inconsistent log rotation

Lionel Cons lionel.cons at cern.ch
Wed Aug 10 06:58:47 BST 2011


Alexandru Scvorcov writes:
 >   1. When RabbitMQ is started up, it will always start on a new file.
 >   To prevent loss of information, we always append the current log file
 >   to the end of a backup file (whose filename is constructed by
 >   appending RABBITMQ_BACKUP_EXTENSION).

RABBITMQ_BACKUP_EXTENSION defaults to ".1" so log information will be
lost anyway after a subsequent restart.

 >   2. When a user manually rotates logs, that is, when a user manually
 >   executes rabbitmqctl rotate_logs or via the init script, the server
 >   appends it's current log to the backup log file (whose name is
 >   constructed by appending ROTATE_SUFFIX) and starts using a
 >   fresh log.
 
AFAIK, ROTATE_SUFFIX defaults to "" so previous log information is
lost (unless copied outside of the init script).

 > Has this behaviour caused any problems for you?

Yes: multiple restarts wiped log information.

IMHO, rabbitmq should not rotate logs on startup but rather, like most
daemons, simply append. The log rotation policy should be external to
rabbitmq (logrotate is fine for this) and rabbitmq should cooperate by
providing an easy to re-open the logs. This is in line with
http://hg.rabbitmq.com/rabbitmq-server/annotate/e4bf0f9afb46/packaging/debs/Debian/debian/rabbitmq-server.logrotate

Cheers,

Lionel


More information about the rabbitmq-discuss mailing list