Skip to content

Commit d69a4cc

Browse files
committed
chore: install sentry log report
1 parent c87e15a commit d69a4cc

File tree

4 files changed

+1256
-110
lines changed

4 files changed

+1256
-110
lines changed

.env.example

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
APP_NAME=Laravel
1+
APP_NAME="WireUI Docs"
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
5+
APP_URL=http://wireui-docs.test
66

77
LOG_CHANNEL=stack
88
LOG_DEPRECATIONS_CHANNEL=null
@@ -11,7 +11,7 @@ LOG_LEVEL=debug
1111
DB_CONNECTION=mysql
1212
DB_HOST=127.0.0.1
1313
DB_PORT=3306
14-
DB_DATABASE=docs
14+
DB_DATABASE=wireui_docs
1515
DB_USERNAME=root
1616
DB_PASSWORD=
1717

@@ -50,3 +50,6 @@ PUSHER_APP_CLUSTER=mt1
5050

5151
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
5252
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
53+
54+
SENTRY_LARAVEL_DSN=
55+
SENTRY_TRACES_SAMPLE_RATE=1

app/Exceptions/Handler.php

+4-17
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,22 @@
77

88
class Handler extends ExceptionHandler
99
{
10-
/**
11-
* A list of the exception types that are not reported.
12-
*
13-
* @var string[]
14-
*/
1510
protected $dontReport = [
1611
//
1712
];
1813

19-
/**
20-
* A list of the inputs that are never flashed for validation exceptions.
21-
*
22-
* @var string[]
23-
*/
2414
protected $dontFlash = [
2515
'current_password',
2616
'password',
2717
'password_confirmation',
2818
];
2919

30-
/**
31-
* Register the exception handling callbacks for the application.
32-
*
33-
* @return void
34-
*/
3520
public function register()
3621
{
37-
$this->reportable(function (Throwable $e) {
38-
//
22+
$this->reportable(function (Throwable $exception) {
23+
if (app()->bound('sentry') && $this->shouldReport($exception)) {
24+
app('sentry')->captureException($exception);
25+
}
3926
});
4027
}
4128
}

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"laravel/sanctum": "^2.11",
1717
"laravel/tinker": "^2.5",
1818
"livewire/livewire": "^2.8",
19-
"ph7jack/wireui": "^0.14.2"
19+
"ph7jack/wireui": "^0.14.2",
20+
"sentry/sentry-laravel": "^2.10"
2021
},
2122
"require-dev": {
2223
"facade/ignition": "^2.5",

0 commit comments

Comments
 (0)