Can I use logrotate for the queue_log file?

2011-03-01
On a QueueMetrics system, it is often not necessary to rotate the queue_log file.

If you really need to rotate the queue_log file, you can do this provided that you are using SQL data storage and have qloaderd installed. The qloaderd process must be notified as soon as the file are rotated.

The following logrotate directive can be used:
/var/log/asterisk/queue_log {
  weekly
  missingok
  rotate 10
  notifempty
  sharedscripts
  create 0640 asterisk asterisk
  postrotate
    /etc/rc.d/init.d/qloaderd restart > /dev/null 2> /dev/null
  endscript
}

This code will perform weekly rotations and will keep an archive of 10 weeks of data. We suggest in any case to keep a complete backup of all queue_log data that gets written, in order to allow for future analysis.

For further details about log file rotation, refer to the following link: log file rotation