How do I get Microsoft Azure to capture my errors?
I'mcurrentlyhandlingerrorswiththisfunction:
<?php/**PluginName:TESTEDescription:testandolognovoVersion:1.0Author:VtesteAuthorURI:teste-------LICENSE:Thisfileissubjecttothetermsandconditionsdefinedinfile'license.txt',whichispartofAdvancedAccessManagersourcepackage.**///errorhandlerfunctionfunctionmyErrorHandler($errno,$errstr,$errfile,$errline){switch($errno){caseE_USER_ERROR:$erro="<b>My ERROR</b> [$errno] $errstr<br />\n";
$erro += " Fatal error on line $errline in file $errfile";
$erro += ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
$erro += "Aborting...<br />\n";
echo $erro;
exit(1);
break;
case E_USER_WARNING:
$erro = "<b>My WARNING</b> [$errno] $errstr\n";
break;
case E_USER_NOTICE:
$erro = "<b>My NOTICE</b> [$errno] $errstr\n";
break;
default:
$erro = "Unknown error type: [$errno] $errstr, linha:$errline, no arquivo $errfile";
error_log($erro);
break;
}
/* Don't execute PHP internal error handler */
return true;
}
// function to test the error handling
function scale_by_log($vect, $scale)
{
if (!is_numeric($scale) || $scale <= 0) {
trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", E_USER_ERROR);
}
if (!is_array($vect)) {
trigger_error("Incorrect input vector, array of values expected", E_USER_WARNING);
return null;
}
$temp = array();
foreach($vect as $pos => $value) {
if (!is_numeric($value)) {
trigger_error("Value at position $pos is not a number, using 0 (zero)", E_USER_NOTICE);
$value = 0;
}
$temp[$pos] = log($scale) * $value;
}
return $temp;
}
// set to the user defined error handler
$old_error_handler = set_error_handler("myErrorHandler");
?>
And I use the Application Insights | Microsoft Azure , however it is not collecting any kind of error, so I would like to manually submit how could I do?