Welcome Guest, Not a member yet? Register   Sign In
Error Handling - send message to site admin
#3

[eluser]jdav3579[/eluser]
Hi thanks for your reply. Basically I want to capture any errors that the site generates and mail them to me.
In a non-CI site, I would do something like:

function myErrorHandler($errno, $errstr, $errfile, $errline)
{
$msg="error level: {$errno} {$errstr}";
mail('[email protected]','Site has errored',$msg);
}

set_error_handler("myErrorHandler");

This way rather than outputing the problems to the users browser, it sends me an email instead.


In some of my code, I may also use the following:
trigger_error("Value at position $pos is not a number, using 0 (zero)", E_USER_NOTICE);

The above is not my code but modified examples off PHP.net just as an example of what I am trying to achieve.
I was wondering if I can easily modify code igniter to mail any errors to me.

Cheers
John


Messages In This Thread
Error Handling - send message to site admin - by El Forum - 07-24-2009, 09:56 AM
Error Handling - send message to site admin - by El Forum - 07-24-2009, 11:07 AM
Error Handling - send message to site admin - by El Forum - 07-24-2009, 03:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB