Skip to content

Commit

Permalink
Use Sentry instead of Bugsnag for error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Dec 1, 2017
1 parent b998037 commit a9047c1
Show file tree
Hide file tree
Showing 9 changed files with 533 additions and 766 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ GITHUB_AUTOJOINER_SECRET=
RECAPTCHA_PUBLIC_KEY=
RECAPTCHA_PRIVATE_KEY=

BUGSNAG_API_KEY=
SENTRY_DSN=
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
\Bugsnag\BugsnagLaravel\Commands\DeployCommand::class,
//
];

/**
Expand Down
4 changes: 4 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class Handler extends ExceptionHandler
*/
public function report(Exception $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}

parent::report($exception);
}

Expand Down
3 changes: 1 addition & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function boot()
*/
public function register()
{
$this->app->alias('bugsnag.logger', \Illuminate\Contracts\Logging\Log::class);
$this->app->alias('bugsnag.logger', \Psr\Log\LoggerInterface::class);
//
}
}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"type": "project",
"require": {
"php": ">=7.0.0",
"bugsnag/bugsnag-laravel": "^2.0",
"fideloper/proxy": "~3.3",
"google/recaptcha": "~1.1",
"graham-campbell/github": "^6.0",
Expand All @@ -18,12 +17,13 @@
"league/commonmark": "^0.15.6",
"orgmanager/orgmanager-logos": "^1.0",
"php-http/cache-plugin": "^1.4",
"php-http/guzzle6-adapter": "^1.1"
"php-http/guzzle6-adapter": "^1.1",
"sentry/sentry-laravel": "^0.8.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "dev-master",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "~6.0"
},
"autoload": {
Expand Down
Loading

0 comments on commit a9047c1

Please sign in to comment.