Skip to content

Fix Monolog v3 compatibility for Magento 2.4.8#208

Open
rk-2083 wants to merge 1 commit intovippsas:masterfrom
rk-2083:master
Open

Fix Monolog v3 compatibility for Magento 2.4.8#208
rk-2083 wants to merge 1 commit intovippsas:masterfrom
rk-2083:master

Conversation

@rk-2083
Copy link
Copy Markdown

@rk-2083 rk-2083 commented Apr 8, 2026

Problem

Running bin/magento setup:upgrade on Magento 2.4.8 throws a fatal PHP error:

PHP Fatal error: Declaration of Vipps\Payment\Model\Logger\Handler\Debug::isHandling(array $record): bool
must be compatible with Monolog\Handler\AbstractHandler::isHandling(Monolog\LogRecord $record): bool
in .../Model/Logger/Handler/Debug.php on line 67

Monolog v3 (shipped with Magento 2.4.8) changed the isHandling() signature
from array $record to Monolog\LogRecord $record, making the module completely
unusable — even bin/magento module:disable fails.

Fix

Updated isHandling() parameter type in Model/Logger/Handler/Debug.php
to accept \Monolog\LogRecord|array $record, compatible with both Monolog v2 and v3.

Tested on

Magento 2.4.8-p4 with Monolog v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant