mirror of https://github.com/MISP/MISP
new: [internal] New AppModel::logException method
parent
cebe7de575
commit
acd90d9675
|
@ -2362,4 +2362,21 @@ class AppModel extends Model
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param Exception $exception
|
||||
* @param int $type
|
||||
* @return bool
|
||||
*/
|
||||
protected function logException($message, Exception $exception, $type = LOG_ERR)
|
||||
{
|
||||
$message = sprintf("%s\n[%s] %s",
|
||||
$message,
|
||||
get_class($exception),
|
||||
$exception->getMessage()
|
||||
);
|
||||
$message .= "\nStack Trace:\n" . $exception->getTraceAsString();
|
||||
return $this->log($message, $type);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue