refactoring.
This commit is contained in:
@@ -25,7 +25,7 @@ return array(
|
||||
'Cache' => 'Laravel\\Cache',
|
||||
'Config' => 'Laravel\\Config',
|
||||
'Controller' => 'Laravel\\Controller',
|
||||
'Cookie' => 'Laravel\\Cookie',
|
||||
'Cookie' => 'Laravel\\Facades\\Cookie',
|
||||
'Crypter' => 'Laravel\\Facades\\Crypter',
|
||||
'DB' => 'Laravel\\Database\\Manager',
|
||||
'Eloquent' => 'Laravel\\Database\\Eloquent\\Model',
|
||||
@@ -34,20 +34,20 @@ return array(
|
||||
'Hasher' => 'Laravel\\Facades\\Hasher',
|
||||
'HTML' => 'Laravel\\HTML',
|
||||
'Inflector' => 'Laravel\\Inflector',
|
||||
'Input' => 'Laravel\\Input',
|
||||
'Input' => 'Laravel\\Facades\\Input',
|
||||
'IoC' => 'Laravel\\IoC',
|
||||
'Lang' => 'Laravel\\Lang',
|
||||
'Loader' => 'Laravel\\Loader',
|
||||
'Messages' => 'Laravel\\Validation\\Messages',
|
||||
'Package' => 'Laravel\\Facades\\Package',
|
||||
'URI' => 'Laravel\\URI',
|
||||
'URI' => 'Laravel\\Facades\\URI',
|
||||
'URL' => 'Laravel\\URL',
|
||||
'Redirect' => 'Laravel\\Redirect',
|
||||
'Request' => 'Laravel\\Request',
|
||||
'Request' => 'Laravel\\Facades\\Request',
|
||||
'Response' => 'Laravel\\Response',
|
||||
'Session' => 'Laravel\\Facades\\Session',
|
||||
'Str' => 'Laravel\\Str',
|
||||
'Validator' => 'Laravel\\Validator',
|
||||
'Validator' => 'Laravel\\Validation\\Validator',
|
||||
'View' => 'Laravel\\View',
|
||||
|
||||
);
|
||||
@@ -2,12 +2,83 @@
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Detail
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Detailed error messages contain information about the file in which
|
||||
| an error occurs, a stack trace, and a snapshot of the source code
|
||||
| in which the error occured.
|
||||
|
|
||||
| If your application is in production, consider turning off error details
|
||||
| for enhanced security and user experience.
|
||||
|
|
||||
*/
|
||||
|
||||
'detail' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Logging
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Error Logging will use the "logger" function defined below to log error
|
||||
| messages, which gives you complete freedom to determine how error
|
||||
| messages are logged. Enjoy the flexibility.
|
||||
|
|
||||
*/
|
||||
|
||||
'log' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Because of the various ways of managing error logging, you get complete
|
||||
| flexibility in Laravel 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" or "Fatal Error".
|
||||
|
|
||||
| A simple logging system has been setup for you. By default, all errors
|
||||
| will be logged to the storage/log.txt file.
|
||||
|
|
||||
*/
|
||||
|
||||
'handler' => function($exception, $severity, $message, $config)
|
||||
{
|
||||
if ($config['detail'])
|
||||
{
|
||||
$data = compact('exception', 'severity', 'message');
|
||||
|
||||
$response = Response::view('error.exception', $data)->status(500);
|
||||
}
|
||||
else
|
||||
{
|
||||
$response = Response::error('500');
|
||||
}
|
||||
|
||||
if ($config['log'])
|
||||
{
|
||||
call_user_func($config['logger'], $severity, $message);
|
||||
}
|
||||
|
||||
$response->send();
|
||||
|
||||
exit(1);
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Error Logger
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Because of the various 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.
|
||||
@@ -21,11 +92,9 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'handler' => function($exception)
|
||||
'logger' => function($severity, $message)
|
||||
{
|
||||
var_dump($exception);
|
||||
|
||||
exit(1);
|
||||
},
|
||||
File::append(STORAGE_PATH.'log.txt', date('Y-m-d H:i:s').' '.$severity.' - '.$message.PHP_EOL);
|
||||
}
|
||||
|
||||
);
|
||||
Reference in New Issue
Block a user