The general handler that I used
<?php
function error_msg($err_type,$err_msg,$err_file,$err_line)
{
$fh=fopen("error/errorlog.txt","a");
$date1=date("Y-m-d H:i:s");
$er="
===============================================================================================================
"."
Error: Type: ".$err_type."Message: ".$err_msg."ErrorFile: ".$err_file."Errorline: ".$err_line."Time: ".$date1.
"
===============================================================================================================
";
fwrite($fh,$er);
fclose($fh);
}
set_error_handler("error_msg");
?>
These log error codes are excellent. Since I use the framework, I cannot use these codes. therefore I use KLogger. KLogger logs my error perfectly, but also displays the error on the front screen for the user.
How to log an error using KLogger. If anyone uses this KLogger Help me use with simple examples.
source
share