Skip Navigation

Dev FAQs

How do I get more information from the PHP error log?

Every time PHP throws a low-ish level error, Reason's error handler catches it, logs it, and takes appropriate action. The log file is specified in the error handler itself (/global_stock/php/error_handler.php) as a constant. This file is a CSV file that can be easily parsed by the program /usr/local/sbin/error_watcher.php. A usual usage of this script looks something like this: cat /tmp/php-errors-apps.carleton.edu | php /usr/local/sbin/error_watcher.php -l2 -v5 So, we're piping the error log to the program (which currently needs to be run by PHP) and given the options l = 2 and v = 5. 'l' corresponds to the lowest level of error you want reported (1 = FATAL, 2 = ERROR, 3 = WARNING, 4 = NOTICE) and 'v' is the verbosity of the report. The default is 1, where only the errors that happened are shown. 2 is the error and the URLs it occurred on (this is the setting the PHP Watcher email script uses), and 5 is all information on all errors (this is a LOT of data). 3 and 4 have not been developed at this time. Anyway, this can get some slightly better information about the error if you want some more. Things like the line number, the script, etc.
  • Dave Hendler, 21 July 2005
  • Keywords: error, error_handler, error log

Other FAQs