Queue_log file rotation issue

I’m facing an issue that is impacting call center functionality.

The issue is: Agents are login to the queues in the morning at 8AM Central time. They also start receiving calls around that time. The issue is that all those records are not written in the queue_log file but in the queue_log-20210226 (the previous file that is already rotated). When I open that rotated file named queue_log-20210226 file at the end I see the following entries:
1614348004|MANAGER|2010|Local/[email protected]/n|ADDMEMBER|
1614348048|MANAGER|2010|Local/[email protected]/n|REMOVEMEMBER|
1614348048|MANAGER|2010|Local/[email protected]/n|ADDMEMBER|
1614348095|MANAGER|2010|Local/[email protected]/n|ADDMEMBER|
1614348156|1614348149.506571|2010|NONE|DID|NXXNXXXXXX
1614348156|1614348149.506571|2010|NONE|ENTERQUEUE||2295600714|1
1614348165|1614348149.506571|2010|Local/[email protected]/n|CONNECT|9|1614348156.506572|8
1614348230|1614348149.506571|2010|Local/[email protected]/n|COMPLETECALLER|9|65|1
1614348342|1614348330.506583|2010|NONE|DID|NXXNXXXXXX
1614348342|1614348330.506583|2010|NONE|ENTERQUEUE||NXXNXXXXXX|1
1614348350|1614348330.506583|2010|Local/[email protected]/n|CONNECT|8|1614348342.506586|8
1614348364|1614348330.506583|2010|Local/[email protected]/n|COMPLETEAGENT|8|14|1

As you see the UNIX time is correct (Friday 26th at 8 AM a member logged in and after that accepted a call from NXXNXXXXXX) but that entry is written in the rotated file and not in the queue_log file. I have to manually issue “logger reload” from Asterisk cli to be able to make asterisk to write into the proper queue_log file. Otherwise it will keep writing all entries into queue_log-20210226 until some point of the current day (around noon).

Any ideas why is that and how to fix it?

Post the contents of your

/etc/logrotate.d/asterisk

Make sure you logger reload in the postrotate in the stanza that rotates the queue log

Also post

ls -l /var/log/asterisk

to check that files are rotated at 06:25 local time

logrotate.d related to queue_log

/var/log/asterisk/queue_log {
daily
missingok
rotate 30
notifempty
sharedscripts
create 0640 asterisk asterisk
su asterisk asterisk
}

ls -l /var/log/asterisk
total 5045684
-rw-rw-r-- 1 asterisk asterisk 0 Feb 14 09:48 adv_recovery.log
-rw-rw-r-- 1 asterisk asterisk 2085677 Feb 14 19:41 backup.log
drwxrwxr-x. 2 asterisk asterisk 6 Dec 23 09:41 cdr-csv
drwxrwxr-x. 2 asterisk asterisk 6 Dec 23 09:41 cdr-custom
-rw-rw-r–. 1 asterisk asterisk 0 Feb 11 07:37 core-fastagi_err.log
-rw-r----- 1 asterisk asterisk 22421581 Feb 26 13:19 core-fastagi_out.log
-rw-rw-r–. 1 asterisk asterisk 56912273 Feb 18 21:48 core-fastagi_out.log-20210219
-rw-r----- 1 asterisk asterisk 66297477 Feb 24 21:16 core-fastagi_out.log-20210225
-rw-r----- 1 asterisk asterisk 301308439 Feb 26 13:19 fail2ban
–w------T 1 asterisk asterisk 24203785 Feb 15 03:25 fail2ban-20210215
-rw-r----- 1 asterisk asterisk 69135316 Feb 16 03:27 fail2ban-20210216
-rw-r----- 1 asterisk asterisk 69976038 Feb 17 03:20 fail2ban-20210217
-rw-r----- 1 asterisk asterisk 68094298 Feb 18 03:42 fail2ban-20210218
-rw-r----- 1 asterisk asterisk 70288310 Feb 19 03:50 fail2ban-20210219
-rw-r----- 1 asterisk asterisk 69759543 Feb 20 03:12 fail2ban-20210220
-rw-r----- 1 asterisk asterisk 66647852 Feb 21 03:22 fail2ban-20210221
-rw-r----- 1 asterisk asterisk 66874786 Feb 22 03:37 fail2ban-20210222
-rw-rw-r-- 1 asterisk asterisk 518700 Feb 26 11:22 firewall.log
-rw-r----- 1 asterisk asterisk 46906499 Feb 26 13:19 freepbx.log
-rw-rw-r–. 1 asterisk asterisk 114099054 Feb 22 03:37 freepbx.log-20210222
–w--wx–T 1 asterisk asterisk 539 Feb 16 16:22 freepbx_security.log
-rw-r–r-- 1 asterisk asterisk 643055419 Feb 26 13:19 full
-rw-r----- 1 asterisk asterisk 1135820106 Feb 25 11:59 full.0
-rw-r----- 1 asterisk asterisk 438890166 Feb 16 03:28 full-20210216
-rw-r----- 1 asterisk asterisk 406276445 Feb 17 03:21 full-20210217
-rw-r----- 1 asterisk asterisk 345889211 Feb 18 03:42 full-20210218
-rw-r----- 1 asterisk asterisk 123836497 Feb 19 03:50 full-20210219
-rw-r----- 1 asterisk asterisk 336939234 Feb 20 03:12 full-20210220
-rw-r----- 1 asterisk asterisk 249407077 Feb 21 03:22 full-20210221
-rw-r----- 1 asterisk asterisk 155317701 Feb 22 03:37 full-20210222
-rw-rw-r-- 1 asterisk asterisk 0 Feb 11 08:14 iot-server.log
-rw-r–r-- 1 asterisk asterisk 600 Feb 26 00:00 pms.log
-rw-r----- 1 asterisk asterisk 1543190 Feb 26 13:18 queue_log
-rw-rw-r–. 1 asterisk asterisk 236 Feb 11 18:52 queue_log-20210212
-rw-rw-r-- 1 asterisk asterisk 118 Feb 12 10:32 queue_log-20210213
-rw-rw-r-- 1 asterisk asterisk 40 Feb 13 03:39 queue_log-20210214
-rw-rw-r-- 1 asterisk asterisk 1912 Feb 14 22:27 queue_log-20210215
-rw-r----- 1 asterisk asterisk 2056192 Feb 15 22:44 queue_log-20210216
-rw-r----- 1 asterisk asterisk 2310753 Feb 16 22:00 queue_log-20210217
-rw-r----- 1 asterisk asterisk 2121051 Feb 17 22:11 queue_log-20210218
-rw-r----- 1 asterisk asterisk 770881 Feb 18 22:00 queue_log-20210219
-rw-r----- 1 asterisk asterisk 2024503 Feb 19 22:00 queue_log-20210220
-rw-r----- 1 asterisk asterisk 1525006 Feb 20 22:00 queue_log-20210221
-rw-r----- 1 asterisk asterisk 940714 Feb 21 19:00 queue_log-20210222
-rw-r----- 1 asterisk asterisk 2253276 Feb 23 11:34 queue_log-20210223
-rw-r----- 1 asterisk asterisk 2383840 Feb 23 22:00 queue_log-20210224
-rw-r----- 1 asterisk asterisk 1347426 Feb 25 11:59 queue_log-20210225
-rw-r----- 1 asterisk asterisk 1726344 Feb 26 08:06 queue_log-20210226
-rw-rw-r-- 1 asterisk asterisk 0 Feb 14 09:51 recording_report
-rw-rw-r-- 1 asterisk asterisk 0 Feb 12 08:06 restapps_err.log
-rw-rw-r-- 1 asterisk asterisk 12755 Feb 26 07:30 restapps.log
-rw-rw-r-- 1 asterisk asterisk 11457 Feb 26 10:45 restapps_out.log
-rw-rw-r-- 1 asterisk asterisk 24240 Feb 26 10:42 ucp_err.log
-rw-rw-r-- 1 asterisk asterisk 75825 Feb 26 10:42 ucp_out.log
-rw-rw-r-- 1 asterisk asterisk 499562 Feb 26 13:15 uniloader.log
-rw-r–r-- 1 root root 284080 Feb 23 10:37 unitracker.log
-rw-rw-r-- 1 asterisk asterisk 32926 Feb 14 21:38 xmpp_err.log
-rw-rw-r-- 1 asterisk asterisk 15219 Feb 14 21:38 xmpp_out.log

Again

Make sure you logger reload in the postrotate in the stanza that rotates the queue log

How did you install FreePBX ?

from the official distro image. I see it there:

{
daily
missingok
rotate 7
notifempty
sharedscripts
create 0640 asterisk asterisk
su asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

Try

/var/log/asterisk/queue_log {
daily
missingok
rotate 30
notifempty
sharedscripts
create 0640 asterisk asterisk
su asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

Thanks…will check if the change has some affect tomorrow.

well, it is still happening…doesn’t make any sense. I’m going to restart the server tonight and see if something will change. Sangoma support advised me to remove queuestats module. I might do that as well.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.