diff --git a/log/.gitignore b/log/.gitignore new file mode 100644 index 00000000..86d0cb27 --- /dev/null +++ b/log/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/system/ErrorHandler.php b/system/ErrorHandler.php index fe50460c..8a5dc5ee 100644 --- a/system/ErrorHandler.php +++ b/system/ErrorHandler.php @@ -18,7 +18,10 @@ class ErrorHandler */ public function register() { - ini_set('display_errors', false); + ini_set("display_errors", 0); + ini_set("log_errors", 1); + ini_set("error_log", sprintf("%s/log/%s-error.log", dirname(__DIR__), date('Y-m'))); + set_exception_handler([$this, 'handleException']); set_error_handler([$this, 'handleError'], error_reporting()); register_shutdown_function([$this, 'handleFatalError']);