GithubHelp home page GithubHelp logo

bugsnag / bugsnag-laravel Goto Github PK

View Code? Open in Web Editor NEW
859.0 43.0 132.0 1.48 MB

BugSnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.

Home Page: https://docs.bugsnag.com/platforms/php/laravel/

License: MIT License

PHP 87.98% JavaScript 0.07% Makefile 0.05% Vue 0.12% Ruby 0.88% Dockerfile 0.26% Shell 0.25% Gherkin 3.13% SCSS 0.01% Blade 7.23%
laravel lumen bugsnag php crash-reporting crash error-monitoring error-reporting debug error-handling

bugsnag-laravel's Introduction

Bugsnag exception reporter for Laravel and Lumen

Build Status StyleCI Status Documentation

The Bugsnag Notifier for Laravel gives you instant notification of errors and exceptions in your Laravel PHP applications. We support both Laravel and Lumen. Learn more about Laravel error reporting from Bugsnag.

Looking for Laravel 4 support?

v1 of our Laravel package supports Laravel 4. You can find it on our 1.7 branch.

Features

  • Automatically report unhandled exceptions and crashes
  • Report handled exceptions
  • Attach user information and custom diagnostic data to determine how many people are affected by a crash

Getting started

  1. Create a Bugsnag account
  2. Complete the instructions in the integration guide for Laravel or Lumen
  3. Report handled exceptions using Bugsnag::notify()
  4. Customize your integration using the configuration options

Support

Contributing

All contributors are welcome! For information on how to build, test, and release, see our contributing guide.

License

The Bugsnag Laravel library is free software released under the MIT License. See LICENSE.txt for details.

bugsnag-laravel's People

Contributors

adamgoose avatar alnutile avatar browner12 avatar cawllec avatar conradirwin avatar dimsav avatar ellefsen avatar fractalwrench avatar gracecheung avatar grahamcampbell avatar gregrobson avatar hannesvdvreken avatar imjoehaines avatar jaketoolson avatar jessicard avatar jpcid avatar kattrali avatar keeganlow avatar loopj avatar mozammil avatar mrsimonbennett avatar rap2hpoutre avatar remipelhate avatar rubenvanerk avatar snmaynard avatar taylorotwell avatar timucingelici avatar tomlongridge avatar twometresteve avatar vinkla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bugsnag-laravel's Issues

bugsnag added as submodule?

I installed bugsnag-laravel as per the usual composer require bugsnag-laravel

and it looks like the bugsnag module is included as a submodule.

screen shot 2014-01-09 at 4 59 34 pm

This is a bit of a problem because i include dependencies in my git repo :(

Configurable user fields

Since you're already adding the id from the logged in user in both the Laravel and Lumen service providers, I propose that you let us configure which user-fields to include in the Bugsnag-report. This way, we avoid having to use global functions or calling setUser() ourselves to add user data.

I already forked the repo and commited a few changes to make this happen and it seemed to work fine. Haven't issued a PR yet, because I wanted to ask you what you think first.

Thanks!

Bugsnag::notifyException($exception) seemingly not working

v1.08 / Laravel 4.2.6: My app throws e.g. validation exceptions that I catch with a dedicated handler as follows:

App::error(function(\MyApp\Validation\ValidationException $exception) {
    return Redirect::back()->withInput()->withErrors($exception->getErrors())->with('message', $exception->getMessage());
});

Now I want Bugsnag to notify me of handled exceptions like the one above. However, inserting Bugsnag::notifyException($exception) before the redirect is not working for me.

App::error(function(\MyApp\Validation\ValidationException $exception) {
    Bugsnag::notifyException($exception);
    return Redirect::back()->withInput()->withErrors($exception->getErrors())->with('message', $exception->getMessage());
});

Generally speaking, inside an App::error() closure - where I think the call should be - nothing seems to happen (same for Bugsnag::notifyError() as far as I can tell) whereas if I put Bugsnag::notifyException(new Exception('test')) anywhere outside an App::error() closure, I get a nice notification in Bugsnag [i.e. my config is okay; app.debug = true, reporting level E_ALL]. Also I noticed that Bugsnag::notifyException($exception) works within an App::missing() closure.

Just in case: If this is due to the "if an exception handler returns a response, that response will be sent to the browser and no other error handlers will be called" according to #16 - how can I get Bugsnag to work for handled exceptions?

Bugsnag requires an API key even if it's not supposed to report

Even if you've set bugsnag to only report exceptions in production, it still requires an api key in other modes. Worst of all, it gets trapped in an endless exception loop where it throws an exception for no api key being present, and then catches it and tries to submit it. repeat.

I solved it by having my config look like this:
'api_key' => env('BUGSNAG_API_KEY', ''),
compared to:
'api_key' => env('BUGSNAG_API_KEY'),

Tag new release

Would be awesome to tag a new version for this change so we can configure the package a bit more "idiomatic Laravel 5" style: a647ec9

Thanks folks! ๐Ÿ˜Š

Lumen 5.1 Auth Check Can Break Exception Responses Unexpectedly

While this might not be a direct Bugsnag issue, it is related to the way the Bugsnag service provider is resolved that triggers this potential issue.

I am running into an issue with the Bugsnag\BugsnagLaravel\BugsnagLumenServiceProvider provider in a Lumen 5.1 environment (see this block of code):

// Check if someone is logged in.
try {
    if ($app['auth']->check()) {
        // User is logged in.
        $user = $app['auth']->user();

        // If these attributes are available: pass them on.
        $client->setUser(array('id' => $user->getAuthIdentifier()));
    }
} catch (\Exception $e) {
    // Do nothing.
}

Out of the box in 5.1 $app['auth'] depends on the memcached extension and thus the Memcached class, yet the Lumen install documentation doesn't require the memcached extension.

You must ensure that you have the memcached extension installed or the block above breaks all app responses that result from an exception. Some apps might not use the auth provider at all and thus will never see this issue until they start trying to integrate bugsnag (or some other package that triggers auth checks).

See this example stack trace for details of what I am running into.

To summarize, I think at the very least it might be wise to point out in the documentation that you need to have the memcached extension installed if you are not using $app['auth'] in a project.

In my case I am using redis for queueing and caching so I needed these environment settings (specifically SESSION_DRIVER) set to overcome the issue even though I am not specifically using auth at all in my application.

CACHE_DRIVER=redis
SESSION_DRIVER=redis

Wrong namespace of exception handler

The namespace of the exception handler class seems to be hardcoded. Due to the PSR4 autoloader in L5 its best practice to rename the namespace of the app directory (http://laravel.com/docs/5.0/configuration#after-installation).

Fatal error: unknown class App\\Exceptions\\Handler in /usr/share/nginx/html/foo/bar/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php on line 7

Handler.php is correctly namespaced, but wrong referenced in BugsnagExceptionHandler.php

use App\Exceptions\Handler as ExceptionHandler;

API key location

Since L5 config/services.php exists. It would be great if the bugsnag API key could be added there and not in it's on file config/bugsnag.php.

Maybe even read the BUGSNAG_API_KEY using env().

Bugsnag Laravel 5.1 Issue

I am seeing what I think is a similar problem to #78. I am using php version 5.6.10 and laravel 5.1.

My Exception/handler.php:

//use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;

I've only made one change to my config/Bugsnag.php

    'notify_release_stages' => null, //['production', 'staging', 'local'],

so it will report in my dev environment (for testing.)

I've also set my BUGSNAG_API_KEY in my .env and if I remove it from my .env, my app issues an error, which I think is a good sign.

Unfortunately, nothing appears in my busgnag dashboard at all. I'm starting to wonder if it's possible that my user's API key doesn't have sufficient permission or something like that. Has anyone seen a similar problem? My configuration is basically out of the box with the exception of turning off notify release stages as they do in the example app.

Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist'

Upgrading Laravel 5.0.x to 5.1, when running composer update I get the following

  [RuntimeException]
  Error Output: PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\sr
  c\Illuminate\Container\Container.php:765
  Stack trace:
  #0 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(765): ReflectionClass->__construct('bugsnag')
  #1 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(645): Illuminate\Container\Container->build('bugsnag', Array)
  #2 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(651): Illuminate\Container\Container->make('bugsnag', Array)
  #3 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(1220): Illuminate\Foundation\Application->make('bugsnag')
  #4 C:\Users\Jesse\Documents\Projects\cw5\vendor\bugsnag\bugsnag-laravel\src\Bugsnag\BugsnagLaravel\BugsnagExceptionHandler.php(25): Illuminate\Container\Container->off in C:\Users\Jesse
  \Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 765
  PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\C
  ontainer\Container.php:765
  Stack trace:
  #0 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(765): ReflectionClass->__construct('bugsnag')
  #1 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(645): Illuminate\Container\Container->build('bugsnag', Array)
  #2 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(651): Illuminate\Container\Container->make('bugsnag', Array)
  #3 C:\Users\Jesse\Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php(1220): Illuminate\Foundation\Application->make('bugsnag')
  #4 C:\Users\Jesse\Documents\Projects\cw5\vendor\bugsnag\bugsnag-laravel\src\Bugsnag\BugsnagLaravel\BugsnagExceptionHandler.php(25): Illuminate\Container\Container->off in C:\Users\Jesse
  \Documents\Projects\cw5\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 765

Everything is where it needs to be, (service provider, facade).

'ReflectionException' with message 'Class bugsnag does not exist'

PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in /home/forge/foobar.nl/storage/framework/compiled.php:1029
Stack trace:
#0 /home/forge/foobar.nl/storage/framework/compiled.php(1029): ReflectionClass->__construct('bugsnag')
#1 /home/forge/foobar.nl/storage/framework/compiled.php(980): Illuminate\Container\Container->build('bugsnag', Array)
#2 /home/forge/foobar.nl/storage/framework/compiled.php(1493): Illuminate\Container\Container->make('bugsnag', Array)
#3 /home/forge/foobar.nl/storage/framework/compiled.php(1213): Illuminate\Foundation\Application->make('bugsnag')
#4 /home/forge/foobar.nl/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php(25): Illuminate\Container\Container->offsetGet('bugsnag')
#5 /home/forge/foobar.nl/app/Exceptions/Handler.php(27): Bugsnag\BugsnagLaravel\BugsnagExceptionHandler->report(Object(ReflectionException))
#6 /home/forge/mijnplusmo in /home/forge/foobar.nl/storage/framework/compiled.php on line 1029
PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class bugsnag does not exist' in /home/forge/foobar.nl/storage/framework/compiled.php:1029
Stack trace:
#0 /home/forge/foobar.nl/storage/framework/compiled.php(1029): ReflectionClass->__construct('bugsnag')
#1 /home/forge/foobar.nl/storage/framework/compiled.php(980): Illuminate\Container\Container->build('bugsnag', Array)
#2 /home/forge/foobar.nl/storage/framework/compiled.php(1493): Illuminate\Container\Container->make('bugsnag', Array)
#3 /home/forge/foobar.nl/storage/framework/compiled.php(1213): Illuminate\Foundation\Application->make('bugsnag')
#4 /home/forge/foobar.nl/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php(25): Illuminate\Container\Container->offsetGet('bugsnag')
#5 /home/forge/foobar.nl/app/Exceptions/Handler.php(27): Bugsnag\BugsnagLaravel\BugsnagExceptionHandler->report(Object(Symfony\Component\Debug\Exception\FatalErrorExc in /home/forge/foobar.nl/storage/framework/compiled.php on line 1029

setBeforeNotifyFunction is not working.

Hello,

I have a Laravel 4.1 application and I have added BugSnag-Laravel to it.

Unfortunately, the setBeforeNotifyFunction isn't working.

Here is my function I created in my helpers.php file which is autoloaded using composer:

function bugsnagBefore($error)
{
    $data = ['user' => null];

    if (\Auth::check()) {
        $data['user'] = [
            'name' => \Auth::user()->username,
            'email' => \Auth::user()->email
        ];
    } else {
        $data['user'] = [
            'name' => 'Guest'
        ];
    }

    $error->setMetaData($data);
}

helpers.php is autoloaded in composer:

"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ],
    "files": [
        "app/LicenseApp/helpers.php"
    ]
},

Then, I told BugSnag about my function in my App::before filter:

App::before(function($request)
{
    \Bugsnag::setBeforeNotifyFunction("bugsnagBefore");
});

This however, doesn't work. The extra information doesn't appear in BugSnag. Any reason why?

Ignore Exceptions

Is there a way to ignore some exceptions?

Like: Symfony\Component\HttpKernel\Exception\NotFoundHttpException and Illumiante\Database\Eloquent\ModelNotFoundException.

Requires publishing configuration

Currently this package requires that configuration be published. This is an annoying step and it would be ideal if we didn't have to publish the config and the package would read the environment variables out of the box.

Invalid Argument Exception Laravel 5

composer require "bugsnag/bugsnag-laravel": "1.*"
[InvalidArgumentException]                                                                                                        
  Could not find package 1.* at any version for your minimum-stability (dev). Check the package spelling or your minimum-stability 

I tried with and without a minimum-stability setting.

FatalErrorException gets sent twice

I was just testing some changes I have made and I noticed that when a fatal syntax error occurs and a Symfony\Component\Debug\Exception\FatalErrorException is thrown Bugsnag is notified twice?

These errors wouldn't make it into our production code of course ๐Ÿ˜‰ I just thought you might want to know in case that's something you need to be aware of.

Where to add username exception

In the tutorial on laracast, Jeffrey Way put it in the global.php file. I do not have that file in laravel 5.1. How do I implement the extra config? Do I have to create the global.php file?

Bugsnag Ignoring Environment

Regardless of how I set my bugsnag configs:

return array(
   'notify_release_stages' => array(
      'development',
      'production',
      'qanda',
      'sandbox',
   ),  
);

Bugsnag is still receiving errors from my local machine (and its being tagged as local, so I know the environment's correct). Looking at the service provider (check out the line I provided), it doesn't look like you're checking the environment before notifying.

I'm I missing something or is this a bug?

Update installation instructions to only publish bugsnag assets

"php artisan vendor:publish" publishes for all packages not only bugsnag, since this command has unwanted sideffects when using other packages it should be changed to only publish bugnsag info.

There are to options that might help
--provider[=PROVIDER] The service provider that has assets you want to publish.
--tag[=TAG] One or many tags that have assets you want to publish. (multiple values allowed)

composer dependency conflicts

Hey guys,

There seems to be a dependency conflict with composer, any ideas?

โฏ composer require "bugsnag/bugsnag-laravel:1.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: fzaninotto/faker[v1.3.0, 1.4.x-dev].
    - Can only install one of: fzaninotto/faker[v1.3.0, 1.4.x-dev].
    - Installation request for fzaninotto/faker 1.3.*@dev -> satisfiable by fzaninotto/faker[v1.3.0].
    - Installation request for fzaninotto/faker == 1.4.9999999.9999999-dev -> satisfiable by fzaninotto/faker[1.4.x-dev].


Installation failed, reverting ./composer.json to its original content.

Using $this when not in object context

After installing this package, I was getting the following error in my log:

[2013-12-10 23:18:27] vagrantlamp.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Using $this when not in object context' in /vagrant/public/example.dev/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php:50
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []

I changed line 50 in the service providor from:

$client->setReleaseStage($this->app->environment());

To:

$client->setReleaseStage($app->environment());

And it seems to work.

update to support 5.1

Please update this app, the instructions in the ReadMe.md, and on the website https://bugsnag.com/accounts/larabin/projects/laravel/integrate to support installation on 5.1

For starters, you need to update the BugsnagLaravelServiceProvider.php to publish config files properly in 5.1, and check/merge user settings.

Also, config\app.php needs to read

# Add `BugsnagLaravelServiceProvider` to the `providers` array
'providers' => [
    Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider::class,
]

# Add the `BugsnagFacade` to the `aliases` array
'aliases' => [
    'Bugsnag' => Bugsnag\BugsnagLaravel\BugsnagFacade::class,
]

php artisan config:publish bugsnag/bugsnag-laravel isn't proper syntax for 5.1

Technically it would be

php artisan vendor:publish --provider="Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider"

but even that wouldn't help until the code is updated.

until then, users need to create a file called bugsnag.php in the config directory with the following contents

<?php

return [
    'api_key' => env('BUGSNAG_API_KEY')
];

and add this to their .env file (for security and git version control purposes)

BUGSNAG_API_KEY=your-api-key

Hope this doesn't come off as rude. You guys provide an awesome service. I would think you would want to be up to date with the development community.

Undefined index: HTTP_HOST

When, for some reasons ,the variable $_SERVER['HTTP_HOST'] is null, this file generate an error
Uncaught exception 'ErrorException' with message 'Undefined index: HTTP_HOST' in
vendor/bugsnag/bugsnag/src/Bugsnag/Request.php on row 74,

return $schema.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

I changed it to:

$host = array_key_exists( 'HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : gethostbyaddr($_SERVER["REMOTE_ADDR"]);
return $schema.$host.$_SERVER['REQUEST_URI'];

It's correct or I'm missing something? Why this can happen?

notifyException creates Segmentation fault on Lumen 5.2

Hi,

I've noticed that the package segfaults with combination of Lumen 5.2 and PHP 7.0.x. Lumen 5.1 does not seem to be affected. Here are steps to reproduce:

composer create-project laravel/lumen bugsnag-lumen-test
cd bugsnag-lumen-test/
composer require bugsnag/bugsnag-laravel:1.*

Then add these two lines to app/bootstrap.php after line 83 + set the config for API key.

$app->register('Bugsnag\BugsnagLaravel\BugsnagLumenServiceProvider');
app('bugsnag')->notifyException(new Exception("Something bad happened"));

If I remove the second line, it works just fine. The backtrace from gdb looks something like this and it just repeats the same three lines.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000774e58 in _zval_copy_ctor_func ()
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
(gdb) bt
#0  0x0000000000774e58 in _zval_copy_ctor_func ()
#1  0x00000000007ec447 in ?? ()
#2  0x00000000007b1d2b in execute_ex ()
#3  0x0000000000767109 in dtrace_execute_ex ()
#4  0x00000000007eea40 in ?? ()
#5  0x00000000007b1d2b in execute_ex ()
#6  0x0000000000767109 in dtrace_execute_ex ()
#7  0x00000000007689fc in zend_call_function ()
#8  0x0000000000791df4 in zend_call_method ()
#9  0x00000000007aa300 in zend_std_read_dimension ()
#10 0x00000000007b2c9b in ?? ()
#11 0x00000000007b35aa in ?? ()
#12 0x00000000007b1d2b in execute_ex ()
#13 0x0000000000767109 in dtrace_execute_ex ()
#14 0x00000000007eea40 in ?? ()
#15 0x00000000007b1d2b in execute_ex ()
#16 0x0000000000767109 in dtrace_execute_ex ()
#17 0x00000000007eea40 in ?? ()
#18 0x00000000007b1d2b in execute_ex ()
#19 0x0000000000767109 in dtrace_execute_ex ()
#20 0x00000000007f3cfd in ?? ()
#21 0x00000000007b1d2b in execute_ex ()
#22 0x0000000000767109 in dtrace_execute_ex ()
#23 0x00000000007eea40 in ?? ()
#24 0x00000000007b1d2b in execute_ex ()
#25 0x0000000000767109 in dtrace_execute_ex ()
#26 0x00000000007eea40 in ?? ()
#27 0x00000000007b1d2b in execute_ex ()
#28 0x0000000000767109 in dtrace_execute_ex ()

Lumen - Class 'Bugsnag\\BugsnagLaravel\\ServiceProvider' not found

There is a problem with Lumen Service Provicer.
in BugsnagLumenServiceProvider.php missing inclusion of Illuminate\Support\ServiceProvider so when runs, gives this error

Class 'Bugsnag\BugsnagLaravel\ServiceProvider' not found in /.../vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php on line 4

Temporarily I have solved adding

use Illuminate\Support\ServiceProvider;

laravel 4.2 no longer logs anything

after installing Bugsnag, Laravel is no longer logging anything on Laravel.log

I have the Bugsnag on Production and Staging turned on. I also have the following on filters.php

App::before(function($request)
{
    if (Auth::user()) {
        $user = Auth::user();
        $now = new DateTime();
        $user->last_activity = $now;
        $user->save();
    }
    Bugsnag::setBeforeNotifyFunction("before_bugsnag_notify");

});

function before_bugsnag_notify($error) {
    // Do any custom error handling here

    // Also add some meta data to each error
    $error->setMetaData(array(
        "user" => array(
            "id" => Auth::user()->id,
            "email" => Auth::user()->email
        )
    ));
}

Argument 1 passed to Bugsnag_Error::setPHPException() must be an instance of Exception, instance of ParseError given

I am running php 7.0 on a homestead server, but I am getting following error:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR) Type error: Argument 1 passed to Bugsnag_Error::setPHPException() must be an instance of Exception, instance of ParseError given, called in /home/vagrant/Projects/project/vendor/bugsnag/bugsnag/src/Bugsnag/Error.php on line 36

What is wrong?

Call to undefined method Bugsnag_Client::setStripPath()

I'm getting the below Error from Bugsnag in a Laravel 5.1 install.

It doesn't seem to happen on all errors but it's definitely an issue as it prevent exceptions from being sent to BugSnag and intercepts the original exception preventing debugging via the log.

E_ERROR: Call to undefined method Bugsnag_Client::setStripPath()
in Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider::Bugsnag\BugsnagLaravel\{closure} called at /var/www/appRoot/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php (62)

FatalErrorException not shown in bugsnag

Hi,

the following exception is not caught by bugsnag-laravel:

exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 
'Allowed memory size of 1585446912 bytes exhausted (tried to allocate 3136499043 bytes)' 
in /home/site.com/app/app/controllers/FileController.php:55

Any ideas why?

I know there is an issue in my code but still, bugsnag should be showing this error.

Feature: Whitelist exceptions

Would be very nice to be able to put an array of whilelisted exceptions in the config. Often you use Exceptions in API responses, like validation etc. But such an exception should not go to Bugsnag, since its thrown by design.

Can you add this?

Not functioning

I've included this package and have published the mentioned configs and set up my API key in .env; I have extended my Exception Handler as instructed. I am not getting any exceptions in my BugSnag control panel, even when calling Bugsnag::notifyError('ErrorType', 'Test Error'); from tinker.

"CURL_IPRESOLVE_V4" bug on hhvm

/bugsnag/bugsnag/src/Bugsnag/notification.php line 110;

curl_setopt($http, CURL_IPRESOLVE_V4, true);

problem with php-hhvm system. If close the this option everything works well

BUGSNAG_NOTIFY_RELEASE_STAGES is ignored

// config/bugsnag.php
...
'notify_release_stages' => env('BUGSNAG_NOTIFY_RELEASE_STAGES', ['production']),
...

// .env
APP_ENV=local
APP_DEBUG=true
...

Though I'm on the local env I still see errors reported to bugsnag.com

Class 'App\Http\Controllers\Bugsnag' not found

When I attempt to use Bugsnag::notifyException or Bugsnag::notifyError, I get the following error (captured in bugsnag itself)

Symfony\Component\Debug\Exception\FatalErrorException
Class 'App\Http\Controllers\Bugsnag' not found

This in a Laravel 5.0.x app

Sorting options

It would be super awesome to have some additional sorting options (if these exist, I haven't yet found them):

  • Sort by number of occurrences
  • Sort reverse of current filters where applicable (ie "Last 7 days" would be "More than 7 days ago"

The use case this evening arose when I needed to delete about a dozen issues that only occurred once or twice, and haven't occurred in the past week.

Severity level default for exceptions should be 'error', not 'warning'

I'm customising my own authentication exceptions as they have a lesser priority that fatal/halting code exceptions (it's normally because people are not logged in, or they are trying things they don't have access to, it's nice to keep an eye on, but normally cause for concern) and after reading the code and docs, it appears that "severity" definitions are not inline with what I have seen in other applications.

Laravel and it's related packages (Monolog) follow the RFC5424 which defines the error levels as follows http://en.wikipedia.org/wiki/Syslog#Severity_levels
Based on this I would expect:

  • Errors to be PHP Exceptions for: divide by 0, syntax errors, null when resource expected
  • Warnings to be what I customise for login failures, 401/403 HTTP statuses that I send out. Worth noting, but not requiring prompt attention.

Currently it appears that Bugsnag sends warning (not error) by default (and by design)? There may be a reason for this I have overlooked, but I think it makes more sense to tell me it's an error as the application has stopped working!

I can use setBeforeNotifyFunction() to check the class name and set severity as required, however I thought you might want to know that it doesn't quite match up to other packages.

Laravel 4.x version of the package

Hi,

According to the documentation from your website to run the bugsnag package for laravel on an older version like 4.2 you need to install bugsnag/bugsnag-laravel:1.* . That will install the current 1.6.3 version of the package.

Till now everything is good but in the versions after 1.2.1 this class Illuminate\Foundation\Exceptions\Handler doesn't exists. Weirdly if you are running php < 5.6 with laravel 4.x the package is working but the moment you upgrade to php version 5.6.x there is an error that pops up.

[ErrorException]                                                  
The use statement with non-compound name 'Bugsnag' has no effect 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.