mirror of https://github.com/MISP/MISP
new: [internal] Send more logs to sentry as breadcrumbs
parent
8934982ff2
commit
3b4e9675dd
|
@ -3825,7 +3825,7 @@ class AppModel extends Model
|
||||||
protected function logException($message, Exception $exception, $type = LOG_ERR)
|
protected function logException($message, Exception $exception, $type = LOG_ERR)
|
||||||
{
|
{
|
||||||
// If Sentry is installed, send exception to Sentry
|
// If Sentry is installed, send exception to Sentry
|
||||||
if (function_exists('\Sentry\captureException') && $type === LOG_ERR) {
|
if (function_exists('\Sentry\captureException') && $type <= LOG_ERR) {
|
||||||
\Sentry\captureException(new Exception($message, $type, $exception));
|
\Sentry\captureException(new Exception($message, $type, $exception));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,6 +259,11 @@ class Log extends AppModel
|
||||||
$change = implode(", ", $output);
|
$change = implode(", ", $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If Sentry is installed, send log breadcrumb to Sentry
|
||||||
|
if (function_exists('\Sentry\addBreadcrumb')) {
|
||||||
|
\Sentry\addBreadcrumb('log', $title, [], Sentry\Breadcrumb::LEVEL_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
$this->create();
|
$this->create();
|
||||||
$result = $this->save(['Log' => [
|
$result = $this->save(['Log' => [
|
||||||
'org' => $user['Organisation']['name'],
|
'org' => $user['Organisation']['name'],
|
||||||
|
|
Loading…
Reference in New Issue