bugsnag / bugsnag-laravel

BugSnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
https://docs.bugsnag.com/platforms/php/laravel/
MIT License
876 stars 129 forks source link

There is a unresolved usage in LaravelLogger file giving error when using with ide-helper package #541

Open mertaydin opened 1 week ago

mertaydin commented 1 week ago

Describe the bug

When you use laravel-bugsnag package with barryvdh/laravel-ide-helper, if you run

php artisan ide-helper:meta 

command giving this error.

Error messages: ``` laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (ReflectionException(code: 0): Class 'Illuminate\\Contracts\\Logging\\Log' not found. ```

Because of in

Bugsnag\BugsnagLaravel\LaravelLogger.php 

file's

  Illuminate\Contracts\Logging\Log 

namespace definition

Steps to reproduce

  1. Go to terminal
  2. run php artisan ide-helper:meta command
  3. open storage/logs/laravel.log (You can open whichever log file is in your project)
  4. See error

Environment

clr182 commented 4 days ago

Hi @mertaydin

Can you please confirm that you have followed the documentation for configuring the logger and ensured correct binding to Psr\Log\LoggerInterface ? This will eliminate the reliance on the deprecated Illuminate\Contracts\Logging\Log interface, which I believe is what was causing the issue.

For convenience you can find those docs here: https://docs.bugsnag.com/platforms/php/laravel/#laravel-5-6

mertaydin commented 1 day ago

Yes, I did everything according to documentation. I don't have any problem with bugsnag. But I think problem is unresolved namespace which was found by ide-helper package. It's scanning all classes for ide helper for autocompletion.

hannah-smartbear commented 1 day ago

Hi @mertaydin,

To help us investigate this further, are you able to provide your full BugSnag configuration, along with your full composer.json file? Or even better, would you be able to provide a stripped down example app that reproduces this?

If you are concerned about sharing these files publicly then please feel free to reach out to us via support@bugsnag.com.