Debugging Your Web Application
This article covers the implementation of a debugging system in your web site or web application. The system is designed to allow debugging of different aspects of your system at any particular time (e.g. SQL queries, filesystem operations, etc..) and writing the debug messages to a log file.
I use this very debugging system for phpRiot, and it makes fixing or further development much easier.