Full log rotation being overwritten

Hey all,

So I have asterisk 11.7.0 installed on Ubuntu 14.04 LTS, I have logrotation set up using logrotate (see below the /etc/logrotate.d/asterisk file config). The issue I’m having is that my full.1 log is being overwitten almost as if the log is being rotated multiple times in 1 reload however messages seems to hold the data somehow(did this because I need to be able to troubleshoot historical calls). Please see below for more details:

logger.conf
rotatestrategy= rotate
debug => debug
;security => security
console => notice,warning,error
;console => notice,warning,error,debug
;messages => notice,warning,error
messages => notice,warning,error,debug,verbose(10),dtmf
full => notice,warning,error,debug,verbose(10),dtmf

/etc/logrotate.d/asterisk:
/var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*log {
missingok
rotate 14
daily
create 0640 asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

full.1 log file:

[Jul 19 06:49:55] Asterisk 11.7.0~dfsg-1ubuntu1 built by buildd @ lamiak on a x86_64 running Linux on 2013-12-24 06:02:10 UTC
[Jul 19 06:49:55] VERBOSE[14079] config.c: == Parsing ‘/etc/asterisk/logger.conf’: Found
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘id’ of type ‘int(10) unsigned’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘time’ of type ‘char(26)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘callid’ of type ‘varchar(32)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘queuename’ of type ‘varchar(32)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘agent’ of type ‘varchar(32)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘event’ of type ‘varchar(32)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘data1’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘data2’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘data3’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘data4’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘data5’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘partition’ of type ‘varchar(100)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘buid’ of type ‘int(5)’
[Jul 19 06:49:55] VERBOSE[14079] res_config_mysql.c: > Found column ‘customer_id’ of type ‘int(5)’
[Jul 19 06:49:55] VERBOSE[14079] logger.c: Asterisk Queue Logger restarted
[Jul 19 06:49:55] VERBOSE[14079] asterisk.c: – Remote UNIX connection disconnected
[Jul 19 06:49:56] VERBOSE[14582] asterisk.c: – Remote UNIX connection
END

1 Like

You are double rotating your logs.

Either set rotatestrategy to none in your logger.conf and just use logrotate.d to rotate your logs or use asterisk to rotate without having an entry in logrotate.d

One or the other, Not both!

Hey John,

Thanks for the advice I’ll give it a shot. It’s a bit strange cos I have 3 boxes with the exact same config mentioned about and they rotate 100%. I’ll update on the result of the change tomorrow once the logs rotate again

Working perfectly, thanks

2 Likes