Drupal debugging FAQ: How can I debug my Drupal form and module development process?
I should know more about this over the next few weeks, but if you're developing Drupal forms and modules, I've found the PHP error_log function and the Drupal watchdog function to be very helpful. They both let you log errors 'somewhere', and the error_log output shows up in your Apache logs, and the watchdog output shows up in your Drupal reports.
Here's how you call the PHP error log function:
error_log("project_id = $project_id");
And in the most basic use, you can call the Drupal watchdog function similarly:
watchdog('sleetmute', "project_id = $project_id");
The only real difference in these function calls is giving the watchdog function a 'category' in the first field, which makes your reporting errors easier to find.
I should note that I also do some debugging using the PHP print_r and var_dump functions. As usual, you use whatever tool works best for your current problem/situation.
I'll add more about the process of debugging your Drupal module and form development process as I learn it, but that's how I do most of my debugging today.
There are a few other ways to log Drupal errors. The Drupal File Logger module lets you write to a custom log file, this page on drupal.org explains how to move the default database logging to be syslog logging, and the Syslog-ng module lets you log using syslog-ng instead of syslogd.