Declaration of Psr\Log\AbstractLogger::emergency event log error

Hi All,

I tried a search in talk but it didn’t show any specific results, I don’t think it’s only happening to me though.

I feel this is something to do with my install of OctoberCMS and package versions, I am always getting this error in the event log when it is unable to show the actual error:

Declaration of Psr\Log\AbstractLogger::emergency($message, array $context = []) must be compatible with Psr\Log\LoggerInterface::emergency(Stringable|string $message, array $context = []): void {"exception":[]}

From what I can see, it’s to do with a mismatch between type declarations or lack thereof.

Of course, I am able to look at my Apache and PHP logs to see the actual issue. I feel that the event log is useful enough and that this is something to do with incompatible package versions.

I am on build 4.1.17, PHP 8.4 and composer 2.9.5

Appreciate any pointers.

Check if you have a conflicting php-psr package installed on your system.
If you for example use Debian and installed another PHP extension through apt, the system might have installed a php-psr package as a dependency.

You then either need to declare the extension in composer or try to solve the version conflict.

See GitHub - jbboehr/php-psr: PHP extension providing the accepted PSR interfaces · GitHub for more information

2 Likes

Thank you @marco.grueter !

It was an old package in a custom plugin that was causing the issue which I can remove as it isn’t needed.

Thanks again for the info.

2 Likes