FreePBX No log

Hello,
I’m taking a VoIP course at a Montreal college and I’m trying to set up a FreePBX server that doesn’t maintain any logs from the PBX and Asterisk. Does anyone know how to automate the deletion of all PBX and Linux VM logs instantly. My goal is to reduce the storage space needed and to prevent the traceability of phone and sms interactions in the server. Thank you in advance for any information I’m new to this so I’m not sure if all this is possible.

I can run a script to remove everything on /var/log/asterisk/* that will clear most of it.
You could also make changes/add logrotate rules to remove them daily or so.

1 Like

Not maintaining logs is generally a very bad idea. For network operators, it can even be illegal, and if you even come here complaining that something doesn’t work, the first thing that will be insisted on is your logs.

However, the only reasonably effective way of suppressing logging is to turn off all categories for every log file, which can be done from the GUI. However you will also have to turn off CDR and CEL logging, I’m not sure if that can be done through the GUI, or if you have to change configuration files directly.

In some cases, simply deleting log files will result in them continuing to grow, but as anonymous files with no directory entries.

1 Like

I am really new to utility programming for automation. If you have some kind of script to rework that would cover all the path to clean up the task I would be interested if you would share it.

I believe it is possible to program a crontab to perform the deletion but perhaps with your expertise there would be a more advanced script to give a better result.

I read on the internet that it was possible for some of the LOGs to add these lines:

AMPDISABLELOG=true

at the end of the file amportal.conf to simply stop the recording of certain logs of Asterisk.

If you had a screenshot of the place in the GUI where I can disable certain LOG would be more than appreciated. I take very seriously your comment about the illegal aspect of my idea but considering that it’s an experiment in a school lab I guess I’m not really breaking the law at least I hope haha.

Are CDR and CEL also deactivatable via the GUI?

in /etc/asterisk/asterisk.conf there is a ‘define’


astlogdir => /var/log/asterisk

you could change to

astlogdir => /dev/null
2 Likes

That will take care of Asterisk logs. There are many more. Maybe echoing ‘nothing’ to all the files would be the best approach.
As it was stated before, note that there will be 0 logs if anything wrong happens.

1 Like

ALL asterisk logging is rooted at that define. Where is the ‘many more’ thing a thing ?

1 Like

Freepbx has logging independent of asterisk, but the same trick should work for that as well

[root@uc-33435257 0]# fwconsole setting --list | grep -i log
| FWJOBS_LOGS                          | 0                                              | 0                                             |
| FPBXDBUGFILE                         | /var/log/asterisk/freepbx_dbug                 | /var/log/asterisk/freepbx_dbug                |
| FPBXPERFLOGGING                      | 0                                              | 0                                             |
| ASTLOGDIR                            | /var/log/asterisk                              | /var/log/asterisk                             |
| DPMAapps_LOG                         | 0                                              | 0                                             |
| PM2DISABLELOG                        | 0                                              | 0                                             |
| QLOGDATARETENTION                    | 0                                              | 0                                             |
| CRM_LOG                              | 1                                              | 1                                             |
| AMPSYSLOGLEVEL                       | FILE                                           | FILE                                          |
| AMPDISABLELOG                        | 0                                              | 0                                             |
| LOG_OUT_MESSAGES                     | 1                                              | 1                                             |
| LOG_NOTIFICATIONS                    | 1                                              | 1                                             |
| FPBX_LOG_FILE                        | /var/log/asterisk/freepbx.log                  | /var/log/asterisk/freepbx.log                 |
| PHP_ERROR_HANDLER_OUTPUT             | freepbxlog                                     | freepbxlog                                    |
2 Likes

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