Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.01k stars 1.9k forks source link

Uncaught Error: Class "Monolog\Logger" not found #1876

Open Justman100 opened 6 months ago

Justman100 commented 6 months ago

Hi, if i use Composer, this comes:

PHP Fatal error: Uncaught Error: Class "Monolog\Logger" not found in /home/mt/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:60 Stack trace:

I use the version 3.5.0

stof commented 6 months ago

This error does not make any sense. The Monolog\Logger class exists in Monolog. Make sure you don't have a corrupted vendor/monolog/monolog folder (you can use composer reinstall monolog/monolog)

Justman100 commented 6 months ago

This error does not make any sense. The Monolog\Logger class exists in Monolog. Make sure you don't have a corrupted vendor/monolog/monolog folder (you can use composer reinstall monolog/monolog)

Still comes

Justman100 commented 6 months ago

It occurs a another error too

PHP Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with PsrExt\Log\LoggerInterface::emergency($message, array $context = []) in /home/mt/vendor/monolog/monolog/src/Monolog/Logger.php on line 681

stof commented 6 months ago

Do you have the psr PHP extension installed ? If yes, please remove it. This extension is totally broken because it does not account for the fact that all psr/* packages have multiple versions. The working way is to rely on the userland implementation of the PSR interfaces which are managed by composer.

Justman100 commented 6 months ago

Do you have the psr PHP extension installed ? If yes, please remove it. This extension is totally broken because it does not account for the fact that all psr/* packages have multiple versions. The working way is to rely on the userland implementation of the PSR interfaces which are managed by composer.

Hmm, removed! But still comes

Justman100 commented 5 months ago

@Seldaek

Seldaek commented 5 months ago

@Justman100 yeah sorry i have no idea.. this seems to be an environment issue.