log($exception); } catch(Exception $e) { // case when the exception is raised before the logger being ready // we handle the exception a la mano, but using the Logger formatting properties require_once "Log/Exception.php"; $event = array(); $event['errno'] = $exception->getCode(); $event['message'] = $exception->getMessage(); $event['errfile'] = $exception->getFile(); $event['errline'] = $exception->getLine(); $event['backtrace'] = $exception->getTraceAsString(); $formatter = new Piwik_Log_Formatter_Exception_ScreenFormatter; $message = $formatter->format($event); $message .= "

And this exception raised another exception \"". $e->getMessage()."\""; Piwik::exitWithErrorMessage( $message ); } }