Tag Archives: PHP in-depth practice

[Solved] Type error: Argument 1 passed to Monolog\Utils::getClass() must be an instance of Monolog\object

Type error: Argument 1 passed to Monolog\Utils::getClass() must be an instance of Monolog\object


Error reason.
Because the PHP version is too high, 2.x minimum requirement PHP7.2 The official original words are as follows:

https://github.com/Seldaek/monolog
Requirements
Monolog ^2.0 works with PHP 7.2 or above, use Monolog ^1.25 for PHP 5.3+ support.

Solution:
composer downgrade monolog/monolog version

"require": {
    "monolog/monolog": "^1.25",
}