Micro Trace helps you to include trace messages into your PHP code. You can easy switch on and off debugging informations, select whether it should display or write into a logfile. You can use log leveles.
Installation is quite easy, just include the file into your php code and you can use the logError, logWarning, logInfo functions.
You can download the tool with an example file in the Download section under Micro Trace