jodohost error logs

mj.

Guppy
How do I view the error logs for my site hosted on jodohost?

I'm finding it time cosuming figuring out which php line of code has an error every time I have a page with an error.

Thanks,
Michael
 
If for some reason your page doesn't display the error on screen in a usable way, you can always write your own error handler function that dumps it into a logfile, sends an email or whatever.

See set_error_handler() and keep in mind the 'magical' constants like __LINE__, __FILE__, __FUNCTION__ and __CLASS__.
 
Thanks that worked great.

In my files I put:
require_once("../cgi-bin/error.php")

I modified some example code to get error.php:

<?php
// set the error reporting level for this script
error_reporting(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE);

// error handler function
function errorHandler($errno, $errstr, $errfile, $errline)
{
switch ($errno) {
case E_USER_ERROR:
echo "<b>My ERROR</b> [$errno] $errstr<br />\n";
echo " Fatal error in line $errline of file $errfile";
echo ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
echo "Aborting...<br />\n";
exit(1);
break;
case E_USER_WARNING:
echo "<b>My WARNING</b> [$errno] $errstr<br />\n";
echo "In line $errline of file $errfile";
break;
case E_USER_NOTICE:
echo "<b>My NOTICE</b> [$errno] $errstr<br />\n";
echo "In line $errline of file $errfile";
break;
default:
echo "Unkown error type: [$errno] $errstr<br />\n";
echo "In line $errline of file $errfile";
break;
}
}

// set to the user defined error handler
$old_error_handler = set_error_handler("errorHandler");

?>
 
Back
Top