1 AMI Events received
2 AMI Commands sent
4 FOP2 Client events received
8 FOP2 Client command sent
For enabling full debug, the level to use is 511 ( 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1)
If you want to enable only AMI Events/Commands, set debug level to 3 ( 2 + 1 )
So, if you want to start FOP2 with full level debug, and storing the debug log (named fop2_debug.log) into the /var/log directory, you should pass the following parameters to the fop2_server binary:
-X 511 -l /var/log
In order to pass those parameters to the service init script you must edit the settings file and add those options. On a Centos/RedHat based system, the file to edit is /etc/sysconfig/fop2 , while on Debian based distributions, the file is named /etc/default/fop2. So go ahead and edit the file, leave any options you might have already set there, like -d, and just append the new options, so it will look similar to this:
OPTIONS="-d -X 511 -l /var/log"It is very important to NOT remove any other command line options you might have specified there, otherwise you will most probably break your init script.
Once the file is modified, restart FOP2. On Centos/RedHat run
service fop2 restart
Once the service is restarted, you will have a /var/log/fop2_debug.log file with information that will help troubleshooting / debugging issues.
By default the fop2_debug.log does not have a timestamp for events. But you can use a dialplan trick/hack in order to get timestamps out of it, you can run this to parse the log and save another log file with timestamps in it:
tail -f file |xargs -IX printf "$(date -u)\t%s\n" X > /var/log/fop2_debug_timestamps.log &
Be careful as the log file will grow really big if you enable full debug, and if you do not take care of log rotations it might fill your hard disk if you forgot to turn debug off.
To remove debug, just edit the same file you changed before and remove the -X and -l parameters from it and restart FOP2 again.