Refactored the logging class to reduce code, use error levels correctly, and improve performance.

This commit is contained in:
Albert Santoni 2015-01-27 18:24:13 -05:00
parent 2b323400fc
commit e83c86a0ff
3 changed files with 42 additions and 50 deletions

View file

@ -74,15 +74,19 @@ try {
$application->bootstrap()->run();
}
} catch (Exception $e) {
echo $e->getMessage();
echo "<pre>";
echo $e->getTraceAsString();
echo "</pre>";
Logging::info($e->getMessage());
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
Logging::error($e->getMessage());
if (VERBOSE_STACK_TRACE) {
Logging::info($e->getTraceAsString());
echo $e->getMessage();
echo "<pre>";
echo $e->getTraceAsString();
echo "</pre>";
Logging::error($e->getTraceAsString());
} else {
Logging::info($e->getTrace());
Logging::error($e->getTrace());
}
die();
}