Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Sentry integration #445

Unanswered
opicodes asked this question in Q&A
Mar 27, 2023 · 1 comment
Discussion options

Tried to post this on a closed issue, maybe it won't be seen there so I'll try here (also it might benefit others).

I'm trying to integrate sentry on a L0 ver 9.2, using laravel-sentry 3.3.2.
I followed the instructions from the post above but I get an error about the Log facade "A facade root has not been set."

Maybe with the updates something changed since 2019?

My config\app.php

 'providers' => [
        EventServiceProvider::class,
        LogServiceProvider::class,
        QueueServiceProvider::class,
        Sentry\Laravel\ServiceProvider::class,
        AppServiceProvider::class,
 ],

failing snippet:

        try {
           throw new \InvalidArgumentException('test');
       } catch(\InvalidArgumentException) {
           Log::channel('daily')->info(
               'test exception caught'
           );
       }

The error:

 Error

  Call to undefined method Psr\Log\NullLogger::channel()

  at vendor/illuminate/support/Facades/Facade.php:338
    334▕         if (! $instance) {
    335▕             throw new RuntimeException('A facade root has not been set.');
    336▕         }
    337▕
  ➜ 338▕         return $instance->$method(...$args);
    339▕     }
    340▕ }
    341▕

  1   ...
      +14 vendor frames
  16  application:37
      LaravelZero\Framework\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

I should add that I already had the Log component installed and it was working (and still does) without adding the ServiceProvider in config\app.php

You must be logged in to vote

Replies: 1 comment

Comment options

can anyone help with this?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.