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

Error with PHP8.1, Laravel 9.x #514

Closed bretthaddoak closed 1 year ago

bretthaddoak commented 1 year ago

Describe the bug

Declaration of Bugsnag\PsrLogger\BugsnagLogger::log(mixed $level, Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::log($level, $message, array $context = [])

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Environment

Example Repo

Error messages: Declaration of Bugsnag\PsrLogger\BugsnagLogger::log(mixed $level, Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::log($level, $message, array $context = [])
johnkiely1 commented 1 year ago

Hi @bretthaddoak. This looks very similar to a issue raised here: https://github.com/bugsnag/bugsnag-psr-logger/issues/54 with the likely root cause being identified as https://github.com/bugsnag/bugsnag-psr-logger/issues/54#issuecomment-1151297410 Can you confirm if you are using a similar package or have any dependencies that could be using PSR log v1?

https://github.com/bugsnag/bugsnag-psr-logger/issues/54#issuecomment-1146864083 has also been suggested as a workaround.

bretthaddoak commented 1 year ago

Sorry I didn't catch that, got to be one of the dumbest production issues I've encountered recently. It was the php8.1-psr package being installed that was the culprit. Removing it solved the problem. Thanks @johnkiely1