-
-
Notifications
You must be signed in to change notification settings - Fork 198
-
I've added sentry to my project running on Laravel Vapor. But it's not logging any exceptions.
I've even added the sdn to the config file itself:
<?php return [ 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN', 'https://60926bexxxxxxxxxxxxxx')), ... ];
Added the exception handler:
/** * Register the exception handling callbacks for the application. */ public function register() { $this->reportable(function (Throwable $e) { if (app()->bound('sentry')) { app('sentry')->captureException($e); } }); }
Also added the log channel:
...
'vapor' => [
'driver' => 'stack',
'channels' => ['sentry', 'stderr'],
],
'sentry' => [
'driver' => 'sentry',
],
Am I doing anything wrong?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
I do get info logs btw, but no exception logs.
Beta Was this translation helpful? Give feedback.
All reactions
-
https://docs.sentry.io/platforms/php/guides/laravel/
I set up a project on Vapor today, and everything is working just fine following the docs one by one.
Beta Was this translation helpful? Give feedback.
All reactions
-
I noticed that some exceptions work and others don't.
I tried to change it to this (removed the bind check):
/** * Register the exception handling callbacks for the application. */ public function register() { $this->reportable(function (Throwable $e) { app('sentry')->captureException($e); }); }
and then I get an lambda error:
{"message":"Internal Server Error"}So the app()->bound('sentry') returns false.
Beta Was this translation helpful? Give feedback.
All reactions
-
Please use
use Sentry\Laravel\Integration; public function register(): void { $this->reportable(function (Throwable $e) { Integration::captureUnhandledException($e); }); }
Beta Was this translation helpful? Give feedback.