Merge pull request #195 from jonnybarnes/more-compact-slack-notifications

Show more useful info in slack messages
This commit is contained in:
Jonny Barnes 2020-08-15 21:15:29 +01:00 committed by GitHub
commit 141e992ac9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,6 +58,9 @@ class Handler extends ExceptionHandler
],
]);
$exceptionName = get_class($throwable) ?? 'Unknown Exception';
$title = $exceptionName . ': ' . $throwable->getMessage();
$guzzle->post(
config('logging.slack'),
[
@ -69,8 +72,8 @@ class Handler extends ExceptionHandler
'author_name' => app()->environment(),
'author_link' => config('app.url'),
'fields' => [[
'title' => get_class($throwable) ?? 'Unknown Exception',
'value' => $throwable->getTraceAsString() ?? '',
'title' => $title,
'value' => request()->method() . ' ' . request()->fullUrl(),
]],
'ts' => time(),
]],