/** * Iterate all exceptions of the given response object and write them into internal log object. * * @param Enlight_Controller_Response_ResponseHttp $response */ public function logException($response) { $exceptions = $response->getException(); if (empty($exceptions)) { return; } $rows = array(array('code', 'name', 'message', 'line', 'file', 'trace')); /** @var $exception Exception */ foreach ($exceptions as $exception) { $rows[] = array($exception->getCode(), get_class($exception), $exception->getMessage(), $exception->getLine(), $exception->getFile(), explode("\n", $exception->getTraceAsString())); } $table = array('Exception Log (' . count($exceptions) . ')', $rows); $this->log->table($table); foreach ($exceptions as $exception) { $this->log->err((string) $exception); } }