Frontend debugging tips
This page details tips about debugging Savannah frontend (PHP code and such).
It is highly recommended to debug new features on a dedicated FrontEndDevelopmentSite or when RunningSavaneLocally. Avoid meddling with the real public website as much as possible.
PHP debugging
Print messages to Apache log
In the PHP code, call trigger_error ("hello world");
to send the message
to Apache log. It will be the error log or PHP log, depending
on your configuration. See details below.
To print a variable, call trigger_error (error_print_r ($VAR));
.
Mailing error reports
Error reports can be sent to email addresses specified in savane.conf.php
.
See the
doc/cc-error
file in Savane source.
Dedicated development site
For website setup according to FrontEndDevelopmentSite, the relevant locations are:
- access log:
/home/[USER]/savannah/var/[USER].access.log
. - error log (STDERR):
/home/[USER]/savannah/var/[USER].error.log
. - PHP error messages:
/home/[USER]/savannah/var/[USER].php-error.log
. - group registration submissions:
/home/[USER]/savannah/var/www/submissions_uploads
. - tracker file attachments:
/home/[USER]/savannah/var/lib/savane/trackers_attachments
. mail logs:
/var/log/mail.log
(Same as the real system, see MailSystem). See FrontEndNotificationEmails for information about setting up email notifications during development.cron jobs: (FIXME)
Local Savane site
The locations can be customized both in configure time and after the installation; a list of default locations follows.
- access log:
$prefix/var/lib/savane/log/apache/access.log
. - error log:
$prefix/var/lib/savane/log/apache/error.log
. - PHP error messages:
$prefix/var/lib/savane/log/apache/sv.php-error.log
. - group registration submissions:
$prefix/var/lib/savane/submissions_uploads
. - tracker file attachments:
$prefix/var/lib/savane/submissions_uploads/trackers_attachments
.
Public website
The following files and directories are used by the public website (which serves https://savannah.gnu.org).
- access log:
/var/log/apache2/access.log
. - error log (STDERR):
/var/log/apache2/error.log
(FIXME: verify). - PHP error messages: same as error log (no separate PHP log for public website).
- group registration submissions:
/var/www/submissions_uploads
. - tracker file attachments:
/var/lib/savane/trackers_attachments
. - mail logs:
/var/log/mail.log
(see MailSystem). - cron jobs:
/etc/cron.d/savane