From 96bce375d449fc802926ace9447df0cc78c831f7 Mon Sep 17 00:00:00 2001 From: Thomas Breuss Date: Sat, 30 Jan 2016 16:40:53 +0100 Subject: [PATCH] Added log dir and enabled error log --- log/.gitignore | 4 ++++ system/ErrorHandler.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 log/.gitignore 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']);