PHP: <?php function error_report($errno, $errstr, $errfile, $errline) { $full_trasing = false; // = true; Полная трассировка, включая дамп переменных $trace = debug_backtrace(); if ($full_trasing) { $tracing = 'Tracing: '.var_export($trace, true).PHP_EOL.PHP_EOL.PHP_EOL; } else { //fast tracing $tracing = 'Tracing: '; for ($i=4;$i--;) { if (isset($trace[$i]["file"])) $tracing .= "File: ".$trace[$i]["file"]."[".$trace[$i]["line"]."] -> "; } $tracing = trim(substr($tracing, 0, -4)); } $log_file_name = SROOT."/system/logs/php.log"; //Адресс лога //Чтобы лог не занял случайно все место ^^ if (file_exists($log_file_name)) { $size = filesize($log_file_name); if ($size >= 1024 * 4096) { return false; } } $message = "[".date("d.m.Y H:i:s")."] E".$errno." [Line ".$errline."]: ". $errfile.PHP_EOL.$errstr.PHP_EOL.$tracing.PHP_EOL.PHP_EOL.PHP_EOL; file_put_contents($log_file_name, $message, FILE_APPEND); } set_error_handler("error_report"); ?> fasttrace: