Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larabug don't send exceptions #71

Closed
leandrohago opened this issue Apr 21, 2022 · 2 comments
Closed

Larabug don't send exceptions #71

leandrohago opened this issue Apr 21, 2022 · 2 comments

Comments

@leandrohago
Copy link

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
@Glennmen
Copy link
Collaborator

You are catching it and nothing is done with it in that case.
Here you can see how the Larabag TestCommand works:

$response = $laraBug->handle(
$this->generateException()
);

@leandrohago
Copy link
Author

Sorry, my mistake.
I forgot to change LOG_CHANNEL in .env to stack.

LOG_CHANNEL=stack

After that all exceptions were sending to dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants