Giter VIP home page Giter VIP logo

larabug's Introduction

LaraBug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x package for logging errors to larabug.com

Software License Latest Version on Packagist Build Status Total Downloads

Installation on laravel

You can install the package through Composer.

composer require larabug/larabug

Then publish the config and migration file of the package using the vendor publish command.

php artisan vendor:publish --provider="LaraBug\ServiceProvider"

And adjust config file (config/larabug.php) with your desired settings.

Note: by default only production environments will report errors. To modify this edit your LaraBug configuration.

Installation on lumen

You can install the package through Composer.

composer require larabug/larabug

Copy the config file (larabug.php) to lumen config directory.

php -r "file_exists('config/') || mkdir('config/'); copy('vendor/larabug/larabug/config/larabug.php', 'config/larabug.php');"

And adjust config file (config/larabug.php) with your desired settings.

In bootstrap/app.php you will need to:

  • Uncomment this line:
    $app->withFacades();
  • Register the larabug config file:
    $app->configure('larabug');
  • Register larabug service provider:
    $app->register(LaraBug\ServiceProvider::class);

Configuration variables

All that is left to do is to define two env configuration variables.

LB_KEY=
LB_PROJECT_KEY=

LB_KEY is your profile key which authorises your account to the API.

LB_PROJECT_KEY is your project API key which you've received when creating a project.

Get the variables at larabug.com

Reporting unhandled exceptions

You can use LaraBug as a log-channel by adding the following config to the channels section in config/logging.php:

'channels' => [
    // ...
    'larabug' => [
        'driver' => 'larabug',
    ],
],

After that you can add it to the stack section:

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'larabug'],
    ],
    //...
],

PS: If you're using lumen, it could be that you don't have the logging.php file. So, you can use default logging file from framework core and make changes above.

php -r "file_exists('config/') || mkdir('config/'); copy('vendor/laravel/lumen-framework/config/logging.php', 'config/logging.php');"

License

The LaraBug package is open source software licensed under the license MIT

larabug's People

Contributors

cannonb4ll avatar cbl avatar glennmen avatar grantholle avatar hajmo avatar jrmajor avatar larsklopstra avatar mateussantana avatar melcus avatar mikemand avatar nickurt avatar paulhennell avatar pauloimon avatar rohansakhale avatar sebastiaankloos avatar sinnbeck avatar taronyuu avatar xheinrich 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

larabug's Issues

php artisan config:cache exception

Hello,

I've been trying to cache my Laravel config files, however, it fails with this exception:

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /***/vendor/larabug/larabug/src/LaraBug.php:118

When I checked the error line, there is this:

if (count(config('larabug.environments')) == 0) {
    return true;
}

However, in config, I have this:

'environments' => [
        'production',
],

Therefore, I do not understand why it returns null.

My Laravel version is 10, my Larabug version is 3.0.

Impossible to delete account

  • I wanted to delete account but I did not find it here https://www.larabug.com/panel
  • or change github account to email account it is impossible too

Background: At first I register via github, it worked. Then I install mobile app but I realized that in mobile app is impossible to login via github only via password. So I wanted to delete account and register again, but it was impossible. Then I wanted to change github account to email account and it was impossible too ;-)

please add one or better both function to admin panel. Thanks.

Feature request: Add note to issue

I'd like to see a "Add note to this bug" input (or similar). It could be helpful, for example, if I see the issue today, have a solution in mind but I can't solve it until later, so I need this note on a later time.

Hope you get, what I mean.

New Release

There hasn't been a release since november 2020. Maybe it's time to roll out another one?

Different time in website than actual log?

There is different time in Larabug app exceptions view than actual log file?

Exception in log file 2022-04-21 17:54:30 but in Larabug app it shows as 2022-04-21 14:54:30

Am I missing something?

Adding custom data

Is it possible to add custom data to the report / exception?

Thanks for this project!

How I can implement the feedback feature

Hi folks, nice work on this incredible app.

I need some guidance on how to implement the feedback feature on my Laravel app. I couldn't find any docs about it.

I will really appreciate the help.

Have a great day!

Email is being possible to change without verification

When someone tries to update email in their profile, it doesn't send a verification link to the new email address for verification. So, anybody can set any email address for their account.
The vital risk here is that if someone enters the wrong email they'll no longer receive email notification and password reset won't be possible.

Support LogManager to log Exceptions to LaraBug

Laravel 5.6 introduced support for improved logging via config/logging.php, is it possible to create a custom LaraBug-driver to use this, instead of using the app/Exceptions/Handler.php-way?

E.g. by other error reporting tools for Laravel ..

Flare - https://flareapp.io/docs/general/projects
Bugsnag - https://docs.bugsnag.com/platforms/php/laravel/#reporting-unhandled-exceptions
Sentry - https://docs.sentry.io/platforms/php/laravel/#using-laravel-56-log-channels
Rollbar - https://docs.rollbar.com/docs/laravel

email notification is not working

Hey,
currently trying to integrate this to my laravel project. Exceptions are correctly added to the dashboard but i am not receiving any email notification. Already tried turning on and off the "receive email notificatin" settings for the project, but its not changing anything.
DId i miss some steps?

Aggregate Exceptions with Same Error

When an error is repeated and has the same name, the number of times it is repeated could be aggregated and displayed, allowing the exceptions listing screen to be less polluted.

Captura de Tela 2022-01-31 às 19 07 19

Support Laravel 8

Hello there,

Does the next version of Larabug support Laravel 8? The current version only supports to Laravel 7.

Collaborate

Hi!, it is good idea to add collaborators here in future? like project can share to other larabug users?

Thank you

Not receive Exception Send

I have a project in Ploi with Larabug, and sending the test or even errors, it says it is sent to Larabug, but nothing arrives on the panel, what may be happening?

Captura de Tela 2023-01-23 às 10 20 00

Larabug don't send exceptions

After install and configure LaraBug with composer, I just run the artisan command to test it and work like a charm.
php artisan larabug:test

/usr/src/app $ php artisan larabug:test
✓ [Larabug] Found login key
✓ [Larabug] Found project key
✓ [Larabug] Correct environment found (local)
✓ [LaraBug] Sent exception to LaraBug with ID: 04e75414-4a62-4982-9086-4dfc7756772c

But when I force a exception to test it, I dont't receive anything on dashboard.
I created a command to test it:

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class SendTestLaraBug extends Command
{
    protected $signature = 'larabug:sendtestlarabug';

    protected $description = 'Command description';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        try {
            throw new \Exception('Send LaraBug Test');
        } catch (\Exception $exception) {
            return $exception;
        }

        return Command::SUCCESS;
    }
}

php artisan larabug:sendtestlarabug

What I'm doing wrong ?

Config:

  • PHP 7.4.20
  • Laravel 8.68.1
  • Larabug 2.5.1

Error when run php artisan larabug:test

i just following the introduction installation and usage on documentation but when finished and i am run php artisan larabug:test return error message.
✓ [Larabug] Found login key
✓ [Larabug] Found project key
✗ [LaraBug] Environment (local) not allowed to send errors to LaraBug, set this in your config
More information about environment configuration: https://www.larabug.com/docs/how-to-use/installation
✗ [LaraBug] Failed to send exception to LaraBug

how i can fix it?

Missing email notification channel

Hi, thanks for making this free tool.

I would like to know if this package implements an email notification channel. I have not yet found documentation about it.

Regards.

Cartalyst Sentinel support

Hello,

Would it be possible to support getting the user from Sentinel instead of Laravel's auth?

Thank you!

DSM key config

Just a single key with all the config / credentials to post exceptions to LaraBug

Unable to create configured logger

Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Driver [larabug] is not supported. at /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:213) [stacktrace] #0 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(125): Illuminate\\Log\\LogManager->resolve() #1 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(112): Illuminate\\Log\\LogManager->get() #2 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(101): Illuminate\\Log\\LogManager->driver() #3 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(261): Illuminate\\Log\\LogManager->channel() #4 [internal function]: Illuminate\\Log\\LogManager->Illuminate\\Log\\{closure}() #5 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(695): array_map() #6 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(354): Illuminate\\Support\\Collection->map() #7 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(262): Illuminate\\Support\\Collection->flatMap() #8 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(210): Illuminate\\Log\\LogManager->createStackDriver() #9 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(125): Illuminate\\Log\\LogManager->resolve() #10 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(112): Illuminate\\Log\\LogManager->get() #11 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(590): Illuminate\\Log\\LogManager->driver() #12 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(252): Illuminate\\Log\\LogManager->error() #13 /var/www/html/sejawat/app/Exceptions/Handler.php(39): Illuminate\\Foundation\\Exceptions\\Handler->report() #14 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): App\\Exceptions\\Handler->report() #15 /var/www/html/sejawat/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\\Foundation\\Http\\Kernel->reportException() #16 /var/www/html/sejawat/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle() #17 {main} "}

allow_url_fopen - should be enabled to use Larabug

Hi, this is not the issue itself but a notice.
I had a problem when running Larabug on the server where I have allow_url_fopen set to Off.
TestCommand does not inform about this - it shows only general info.
Can you add this information to guide/notes and additional check for this in TestCommand?

Thanks

Tracking request parameters

Hi, everyone! I wondered if there is a reason why the request parameters are not logged. This can be very usefull in some cases. (Would do a pr if this would be accepted)

422 Unprocessable Entity error from larabug api

Hey, I haven't received any exceptions for a few days.
I tested with the following exception:

public function me(Request $request)
{
    throw new Exception();
    return new UserResource($request->user());
}

Inside the report function in Client.php, a Guzzle-Request-Exception is thrown with the following message:

Client error: `POST https://www.larabug.com/api/log` resulted in a `422 Unprocessable Entity` response:
{"error":"Did not receive the correct parameters to process this exception"}

The login and project-id is set correctly, as well the user and exception parameters.

Tested with version 2.3.1

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.