Search for:

Version 4 of 6.8.10, 12:20
Home - Latest - Tags - History - Referers

Create user - Lost password
Just visited:
AstRecipes»Avoiding queue_log file rotation

And all is quiet....

AstRecipes » 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:

/var/log/asterisk/*log {
   rotate 5
   create 0640 asterisk asterisk
       /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null

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?

Loway offers a script that makes it trivial to do the import without following the manual procedure - you'll find it here:

Do an automated install using yum.

Manual procedure

If your queue_log has already been rotated, you'll want to join the remaining pieces together. That's very easy:

star First, stop Asterisk.
star Make a backup of all queue_log* files
star Rename the existing queue_log to
star Execute the following commands (I give examples for 5 leftover pieces, you may find a different number on your system):

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

star Remove all files but queue_log itself
star Restart Asterisk.

This should be it. Now your QueueMetrics will work just fine.