/tmp/freepbx_debug.log at 785 MB and growing

We have been using the FreePBX distro for a couple of months now and noticed that performance seems to have gotten a bit sluggish. When we looked around we found the freepbx log file /tmp/freepbx_debug.log at 785 MB and growing. I checked our advanced settings and “Disable FreePBX debug Logging = True” so here is my question.

  1. Isn’t there a way to turn the log file off?

  2. Shouldn’t we prevent the file from growing forever? If it grows forever it would eventually bring the whole system down and most users are not even aware of this file.

  3. Can we delete the file periodically without impacting the system?

You should file a bug on this and assign it to mbrevda. Otherwise it will never get noticed.

On a box that is up but not yet carrying traffic the file has grown to 49M, there are thousands of lines of the following errors:

2011-Nov-03 11:11:02 /var/www/html/admin/libraries/xml2Array.class.php:59
[WARNING]: array_push(): Cannot add element to the array as the next element is already occupied

2011-Nov-04 13:08:12 /var/www/html/admin/modules/sysadmin/functions.inc/licensed.php:0
[WARNING]: No license for this product (‘PBXact’) - make sure zend_optimizer.license_path is properly configured in php.ini!

2011-Nov-04 13:08:12 /var/www/html/admin/modules/sysadmin/functions.inc/licensed.php:0
[WARNING]: License check failed!

2011-Nov-04 10:08:12 /var/www/html/admin/modules/endpointman/includes/rain.tpl.class.php:0
[NOTICE]: Undefined index: 0

2011-Nov-04 10:08:12 /var/www/html/admin/modules/endpointman/includes/rain.tpl.class.php:0
[NOTICE]: Undefined index: 1

2011-Nov-04 10:08:12 /var/www/html/admin/modules/endpointman/includes/rain.tpl.class.php:0
[NOTICE]: Undefined index: 2

I notice that Disable FreePBX dbug Logging is set to true in Advanced Options, it seems to me that writing to the debug file should be disabled.

This is probably a bug. The only way to get it fixed is to file a bug report so the developers can fix it.

It is probably OK to delete the file. It is just a debug log.

I deleted the file on one of my test boxes and it is recreated so there is no harm in deleting it. You could create a cron job to periodically delete the file.

Do not create a cron job to delete the file. Logrotate needs to be setup.

/etc/logrotate.conf


[vg2.xxx.net etc]# cat logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    minsize 1M
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.

The in logrote.d you should find the asterisk file

cat/logrotate.d/asterisk


/var/log/asterisk/messages /var/log/asterisk/*log /var/log/asterisk/debug /var/log/asterisk/console /var/log/asterisk/full {
    create 0640 asterisk asterisk
    daily
    extension .txt
    mail [email protected]
    missingok
    nocompress
#    notifempty
    rotate 32
    sharedscripts
#    size 10M
    postrotate
        /usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>/dev/null || true
    endscript
}

/var/log/asterisk/cdr-csv/*csv /var/log/asterisk/cdr-custom/*csv {
    create 0640 asterisk asterisk
    monthly
    extension .txt
    mail [email protected]
    missingok
    nocompress
#    notifempty
    rotate 2
    sharedscripts
#    size 10M
    postrotate
        /usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>/dev/null || true
    endscript
}

[vg2.xxx.net logrotate.d]#

I just checked a distro install and it was configured correctly.

Skyking

I agree that logrotate is the better solution. The cron job was just a quick and dirty way to get the file deleted.

I do not see anywhere in the logrotate config you posted above the rotates the file /tmp/freepbx_debug.log

In any event this still looks like a bug to me. Either logrotate is not setup to delete /tmp/freepbx_debug.log in the distro or /tmp/freepbx_debug.log is being written in /tmp rather than /var/log/asterisk.

I thought your Asterisk logs were growing. See what I get for not reading the message.

That debug log should be turned off. It also should not be that large.

The debug file itself rotates when it gets close to 2 GB in size since most systems have a per file size limit of 2GB. It looks like there is a bug in with setting debug to be off not working. We are looking into the issue and should have it solved soon.

I would like to know if the setting to turn debug logs off is now working. Please drop me a line when you have a chance.

Thanks!

Test and see. That is the best way to know.

I did test, and it’s still there and growing, even though in advanced settings ‘Disable FreePBX dbug Logging’ is set to True.

Thanks for the reply!

Well than someone needs to open a bug.