Skip to content

Commit

Permalink
➕ Adding Bugsnag
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Mar 1, 2017
1 parent 5b3ff78 commit cc522a4
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ GITHUB_CALLBACK=

RECAPTCHA_PUBLIC_KEY=
RECAPTCHA_PRIVATE_KEY=

BUGSNAG_API_KEY=
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ 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);
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"require": {
"php": ">=5.6.4",
"adamwathan/eloquent-oauth-l5": "^0.5.1",
"bugsnag/bugsnag-laravel": "^2.0",
"google/recaptcha": "~1.1",
"laravel/framework": "5.3.*",
"m1guelpf/github": "dev-master",
Expand Down
3 changes: 2 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
AdamWathan\EloquentOAuthL5\EloquentOAuthServiceProvider::class,
GrahamCampbell\GitHub\GitHubServiceProvider::class,
Kamaln7\Toastr\ToastrServiceProvider::class,
Bugsnag\BugsnagLaravel\BugsnagServiceProvider::class,

/*
* Application Service Providers...
Expand Down Expand Up @@ -231,7 +232,7 @@
'GitHub' => GrahamCampbell\GitHub\Facades\GitHub::class,
'Toastr' => Kamaln7\Toastr\Facades\Toastr::class,
'Input' => Illuminate\Support\Facades\Input::class,

'Bugsnag' => Bugsnag\BugsnagLaravel\Facades\Bugsnag::class,
],

];
219 changes: 219 additions & 0 deletions config/bugsnag.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| API Key
|--------------------------------------------------------------------------
|
| You can find your API key on your Bugsnag dashboard.
|
| This api key points the Bugsnag notifier to the project in your account
| which should receive your application's uncaught exceptions.
|
*/

'api_key' => env('BUGSNAG_API_KEY', ''),

/*
|--------------------------------------------------------------------------
| App version
|--------------------------------------------------------------------------
|
| Set the type of application executing the current code.
|
*/

'app_type' => env('BUGSNAG_APP_TYPE'),

/*
|--------------------------------------------------------------------------
| App Version
|--------------------------------------------------------------------------
|
| Set the version of application executing the current code.
|
*/

'app_version' => env('BUGSNAG_APP_VERSION'),

/*
|--------------------------------------------------------------------------
| Batch Sending
|--------------------------------------------------------------------------
|
| Set to true to send the errors through to Bugsnag when the PHP process
| shuts down, in order to prevent your app waiting on HTTP requests.
|
| Setting this to false will mean the we send an HTTP request straight away
| for each error.
|
*/

'batch_sending' => env('BUGSNAG_BATCH_SENDING'),

/*
|--------------------------------------------------------------------------
| Endpoint
|--------------------------------------------------------------------------
|
| Set what server the Bugsnag notifier should send errors to. By default
| this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise
| this should be the URL to your Bugsnag instance.
|
*/

'endpoint' => env('BUGSNAG_ENDPOINT'),

/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
|
| Use this if you want to ensure you don't send sensitive data such as
| passwords, and credit card numbers to our servers. Any keys which
| contain these strings will be filtered.
|
*/

'filters' => empty(env('BUGSNAG_FILTERS')) ? ['password'] : explode(',', str_replace(' ', '', env('BUGSNAG_FILTERS'))),

/*
|--------------------------------------------------------------------------
| Hostname
|--------------------------------------------------------------------------
|
| You can set the hostame of your server to something specific for you to
| identify it by if needed.
|
*/

'hostname' => env('BUGSNAG_HOSTNAME'),

/*
|--------------------------------------------------------------------------
| Proxy
|--------------------------------------------------------------------------
|
| This is where you can set the proxy settings you'd like us to use when
| communicating with Bugsnag when reporting errors.
|
*/

'proxy' => array_filter([
'http' => env('HTTP_PROXY'),
'https' => env('HTTPS_PROXY'),
'no' => empty(env('NO_PROXY')) ? null : explode(',', str_replace(' ', '', env('NO_PROXY'))),
]),

/*
|--------------------------------------------------------------------------
| Protect Root
|--------------------------------------------------------------------------
|
| Bugsnag marks stacktrace lines as in-project if they come from files
| inside your “project root”. You can set this here.
|
| If this is not set, we will automatically try to detect it.
|
*/

'project_root' => env('BUGSNAG_PROJECT_ROOT'),

/*
|--------------------------------------------------------------------------
| Strip Path
|--------------------------------------------------------------------------
|
| You can set a strip path to have it also trimed from the start of any
| filepath in your stacktraces.
|
| If this is not set, we will automatically try to detect it.
|
*/

'strip_path' => env('BUGSNAG_STRIP_PATH'),

/*
|--------------------------------------------------------------------------
| Query
|--------------------------------------------------------------------------
|
| Enable this if you'd like us to automatically record all queries executed
| as breadcrumbs.
|
*/

'query' => env('BUGSNAG_QUERY', true),

/*
|--------------------------------------------------------------------------
| Bindings
|--------------------------------------------------------------------------
|
| Enable this if you'd like us to include the query bindings in our query
| breadcrumbs.
|
*/

'bindings' => env('BUGSNAG_QUERY_BINDINGS', false),

/*
|--------------------------------------------------------------------------
| Notify Release Stages
|--------------------------------------------------------------------------
|
| Set which release stages should send notifications to Bugsnag.
|
*/

'notify_release_stages' => empty(env('BUGSNAG_NOTIFY_RELEASE_STAGES')) ? null : explode(',', str_replace(' ', '', env('BUGSNAG_NOTIFY_RELEASE_STAGES'))),

/*
|--------------------------------------------------------------------------
| Send Code
|--------------------------------------------------------------------------
|
| Bugsnag automatically sends a small snippet of the code that crashed to
| help you diagnose even faster from within your dashboard. If you don’t
| want to send this snippet, then set this to false.
|
*/

'send_code' => env('BUGSNAG_SEND_CODE', true),

/*
|--------------------------------------------------------------------------
| Callbacks
|--------------------------------------------------------------------------
|
| Enable this if you'd like us to enable our default set of notification
| callbacks. These add things like the cookie information and session
| details to the error to be sent to Bugsnag.
|
| If you'd like to add your own callbacks, you can call the
| Bugsnag::registerCallback method from the boot method of your app
| service provider.
|
*/

'callbacks' => env('BUGSNAG_CALLBACKS', true),

/*
|--------------------------------------------------------------------------
| User
|--------------------------------------------------------------------------
|
| Enable this if you'd like us to set the current user logged in via
| Laravel's authentication system.
|
| If you'd like to add your own user resolver, you can call the
| Bugsnag::registerUserResolver method from the boot method of your app
| service provider.
|
*/

'user' => env('BUGSNAG_USER', true),

];

0 comments on commit cc522a4

Please sign in to comment.