Page 1 of 1

Catch error class

Posted: Thu Jan 15, 2004 9:17 am
by fastfingertips
I would like to make an error class to catch all the errors and drop them into a log file or table, so i would like to know if you can make me a recommendation to find best way to resolve this poblem. :?:

Posted: Thu Jan 15, 2004 11:24 am
by McGruff
Is there something further you want to do than can be achieved with php.ini settings?

This will log everything to file.

error_reporting=E_ALL
log_errors=On

This toggles the sending of error messages as part of the output to the client:

display_errors=Off/On

Posted: Thu Jan 15, 2004 7:38 pm
by ilovetoast
Short answer: PEAR, and its packages

phpOO Classes already exist to catch errors, log them any which way, and even implement an Observer paradigm to watch the logs and keep you informed. No sense reinventing the wheel.

peace

Posted: Sun Jan 18, 2004 12:59 pm
by jaxn
This is one of the features of CEP (http://sourceforge.net/projects/cep).

We make use of the PEAR Error objects and maintain a global error array and at the end of the script execution all errors that are supposed to be logged are written to the logfile.

That is an oversimplification of how we do it (it is really cascading error objects), but it works really well.

The API that we use for our error handling is one command too so it is easy to have all the error checking you should have without losing readability.

-Jackson