diff --git a/engine/Monstra.php b/engine/Monstra.php index 1087905..fd9ce39 100644 --- a/engine/Monstra.php +++ b/engine/Monstra.php @@ -113,9 +113,14 @@ class Monstra * Set Gelato Display Errors to False for Production environment. */ if (Monstra::$environment == Monstra::PRODUCTION) { - define('GELATO_DISPLAY_DEVELOPMENT', false); + define('GELATO_DEVELOPMENT', false); } + /** + * Define Monstra Folder for Gelato Logs + */ + define ('GELATO_LOGS_PATH', LOGS); + /** * Include Gelato Library */ diff --git a/libraries/Gelato/ErrorHandler/ErrorHandler.php b/libraries/Gelato/ErrorHandler/ErrorHandler.php index 3a3a572..6a9ee60 100644 --- a/libraries/Gelato/ErrorHandler/ErrorHandler.php +++ b/libraries/Gelato/ErrorHandler/ErrorHandler.php @@ -88,7 +88,7 @@ class ErrorHandler /** * Dont thow NOTICE exception for PRODUCTION Environment. Just write to log. */ - if (GELATO_DISPLAY_DEVELOPMENT == false && $code == 8) { + if (GELATO_DEVELOPMENT == false && $code == 8) { // Get exception info $error['code'] = $code; @@ -275,7 +275,7 @@ class ErrorHandler // Send headers and output @header('Content-Type: text/html; charset=UTF-8'); - if (GELATO_DISPLAY_DEVELOPMENT) { + if (GELATO_DEVELOPMENT) { $error['backtrace'] = $exception->getTrace(); diff --git a/libraries/Gelato/Gelato.php b/libraries/Gelato/Gelato.php index fc7d5d2..49f0b5e 100644 --- a/libraries/Gelato/Gelato.php +++ b/libraries/Gelato/Gelato.php @@ -23,8 +23,8 @@ define('GELATO_VERSION', '1.0.0'); /** * Display Gelato Errors or not ? */ -if ( ! defined('GELATO_DISPLAY_DEVELOPMENT')) { - define('GELATO_DISPLAY_DEVELOPMENT', true); +if ( ! defined('GELATO_DEVELOPMENT')) { + define('GELATO_DEVELOPMENT', true); } /** @@ -42,10 +42,15 @@ require_once __DIR__ . '/Log/Log.php'; /** * Use Gelato Logger default path or not ? */ -if ( ! defined('GELATO_LOGGER')) { - Log::configure('path', __DIR__. '/_logs'); +if ( ! defined('GELATO_LOGS_PATH')) { + define('GELATO_LOGS_PATH', __DIR__. '/_logs'); } +/** + * Configure Gelato Logger + */ +Log::configure('path', GELATO_LOGS_PATH); + /** * Load Gelato Error Handler */ diff --git a/libraries/Gelato/Log/Log.php b/libraries/Gelato/Log/Log.php index c4323da..b80487e 100644 --- a/libraries/Gelato/Log/Log.php +++ b/libraries/Gelato/Log/Log.php @@ -81,7 +81,7 @@ class Log */ public static function write($message, $type = Log::ERROR) { - $file = rtrim(Log::$path, '/') . '/' . Log::$types[$type] . '_' . gmdate('Y_m_d') . '.log'; + $file = rtrim(Log::$path, '/') . '/' . gmdate('Y_m_d') . '.log'; $message = '[' . gmdate('d-M-Y H:i:s') . '] ' . $message . PHP_EOL;