improved error tracking

This commit is contained in:
Denis Duliçi
2022-10-19 01:29:40 +03:00
parent 79380dc3e8
commit 808955294d
5 changed files with 90 additions and 21 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Exceptions\Trackers;
use Throwable;
class Bugsnag
{
public static function beforeSend(Throwable $e): void
{
app('bugsnag')->setAppVersion(version('short'));
app('bugsnag')->registerCallback(function ($report) {
$report->setMetaData([
'akaunting' => [
'company_id' => (string) company_id(),
'locale' => (string) app()->getLocale(),
'timezone' => (string) config('app.timezone'),
]
]);
});
}
}