AstRecipes » Avoiding queue_log file rotationThis version of the page is not up to date - Back to current Avoiding queue_log file rotation
If you run a call center, you will definitely want the log rotation susbsystem not to rotate your queue_log file along with the other Asterisk logs found in /var/log/asterisk. The queue_log file contains essential information on how the call-center is going that is being used by software like QueueMetrics to report on the well-being and the actual work being performed by your CC, and you surely want to keep that data in a safe place for cross-period analysis.
The majority of prebuilt Asterisk distributions will instead lotate that file together with the other Asterisk logs, and this may cause lost data if you do not have a backup. Disabling log rotation
Disabling log rotation is actually quite easy: go to /etc/logrotate.d and look for a file named asterisk. If you run TrixBox, you'll find something like:
There may as well be other sections where other files are rotated. You just delete the section above and the queue_log file will not be rotated anymore. What if my queue_log has already been rotated?
create 0640 asterisk asterisk
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
If your queue_log has already been rotated, you'll want to join the remaining pieces together. That's very easy: First, stop Asterisk.
Rename the existing queue_log to queue_log.now.
Execute the following commands (I give examples for 5 leftover pieces, you may find a different number on your system):
Restart Asterisk. This should be it. Now your QueueMetrics will work just fine.
cat queue_log.5 >> queue_log
cat queue_log.4 >> queue_log
cat queue_log.3 >> queue_log
cat queue_log.2 >> queue_log
cat queue_log.1 >> queue_log
cat queue_log.now >> queue_log