Add this your bootstrap file:
<?php
try{
$di = new Phalcon\DI();
//Main bootstrap code
//etc etc
} catch(\PDOException $e){
//Do something...
} catch(\Phalcon\Exception $e){
//Do something...
} catch(\Exception $e){
echo "Exception: ", $e->getMessage();
if(isset($di) && $di->get('logger')){
$di->get('logger')->error($e);
}
}