Skip to content

Commit

Permalink
Merge pull request #247 from ploi/sentry
Browse files Browse the repository at this point in the history
sentry
  • Loading branch information
Cannonb4ll authored Nov 16, 2023
2 parents 2a6a168 + e2fdbde commit 813c497
Show file tree
Hide file tree
Showing 4 changed files with 593 additions and 310 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ SSO_PROVIDER_ID="id"
SSO_ENDPOINT_AUTHORIZE=${SSO_BASE_URL}/oauth/authorize
SSO_ENDPOINT_TOKEN=${SSO_BASE_URL}/oauth/token
SSO_ENDPOINT_USER=${SSO_BASE_URL}/oauth/user

SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0
33 changes: 3 additions & 30 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,23 @@

namespace App\Exceptions;

use Sentry\Laravel\Integration;
use Throwable;
use Illuminate\Routing\Exceptions\InvalidSignatureException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];

/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
Integration::captureUnhandledException($e);
});

$this->renderable(function (InvalidSignatureException $e) {
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"laravel/socialite": "^5.6.1",
"laravel/tinker": "^2.8.0",
"laravel/ui": "^4.2.0",
"sentry/sentry-laravel": "^4.0",
"spatie/color": "^1.5",
"spatie/laravel-activitylog": "^4.7.3",
"spatie/laravel-honeypot": "^4.3.2",
Expand Down
Loading

0 comments on commit 813c497

Please sign in to comment.