code: public static function activateException(int $iLevel)
      {
          if (self::$_bFirstActivation === true) {
  
              self::_setFileNameInErrorFile();
              self::$_bFirstActivation = false;
          }
  
          self::_initLogFile();
          self::$_bActivateException = true;
  
          set_exception_handler(function ($oException)
          {
              $aContext = array('file' => $oException->getFile(), 'line' => $oException->getLine());
              self::getInstance()->critical($oException->getMessage(), $aContext);
          });
      }
docs: activate Exception
  
  @access public
  @param  int $iLevel level of error
  @return void