code: public function log(\Exception $exception)
      {
          $logData  = date('Y-m-d H:i:s');
          $logData .= $this->exceptionFields($exception);
          $logData .= $this->fieldsForPrevious($exception->getPrevious());
          error_log(
                  $logData . "\n",
                  3,
                  $this->getLogDir() . DIRECTORY_SEPARATOR . 'exceptions-' . date('Y-m-d') . '.log'
          );
      }
docs: logs the exception into a logfile
  
  @param  \Exception  $exception  exception to log