checkout-magento2-plugin icon indicating copy to clipboard operation
checkout-magento2-plugin copied to clipboard

Magento 2.4.2 broken debugging

Open dio5 opened this issue 2 years ago • 1 comments

With debugging enabled, I'm getting the error:

TypeError: Argument 2 passed to Monolog\Logger::debug() must be of the type array, string given

Coming from:

$this->logger->additional('authorization header: ' . $key, 'auth');

which calls

$this->logger->debug('Checkout Logging: ', $msg);

in \CheckoutCom\Magento2\Helper\Logger::write

as Monolog\Logger::debug is expecting an array as second argument.

It seems it might just need to be concatenated instead?

    * @param  string $message The log message
     * @param  array  $context The log context
     * @return bool   Whether the record has been processed
     */
    public function debug($message, array $context = array())

(Also slight note on Magento 2.4.4 is using different version than 2.4.3 of Monolog.)

dio5 avatar Apr 19 '22 09:04 dio5

Although I also notice sometimes arrays are passed to \CheckoutCom\Magento2\Helper\Logger::additional so will need better fixing than concat.

dio5 avatar Apr 19 '22 09:04 dio5