diff --git a/application/config/error.php b/application/config/error.php index dd021e46..360c963e 100644 --- a/application/config/error.php +++ b/application/config/error.php @@ -14,7 +14,7 @@ | */ - 'detail' => true, + 'detail' => false, /* |-------------------------------------------------------------------------- @@ -24,11 +24,32 @@ | Would you like errors to be logged? Error logging can be extremely | helpful when debugging a production application. | - | Note: When error logging is enabled, errors will be logged even when - | error detail is disabled. + */ + + 'log' => true, + + /* + |-------------------------------------------------------------------------- + | Error Logger + |-------------------------------------------------------------------------- + | + | Because of the sundry ways of managing error logging, you get complete + | flexibility to manage error logging as you see fit. + | + | This function will be called when an error occurs in your application. + | You can log the error however you like. + | + | The error "severity" passed to the method is a human-readable severity + | level such as "Parsing Error", "Fatal Error", etc. + | + | A simple logging system has been setup for you. By default, all errors + | will be logged to the application/log.txt file. | */ - 'log' => false, + 'logger' => function($severity, $message) + { + System\File::append(APP_PATH.'storage/log.txt', date('Y-m-d H:i:s').' '.$severity.' - '.$message.PHP_EOL); + }, ); \ No newline at end of file