Question

I am attempting to build a custom payment module but as far as I got I get the error message sh: -t not found when checking out a test order I saw this question but the link in the answer is broken, I cannot place comments and didn't feel appropriate to answer with a question so here I am.

If there are some pointers to how Magento module should be debugged in these cases, usually there get a big dump of a log it hard to see what I'm looking for

EDIT: taking the code from this answer the log file created but is empty, putting it after all operations of the of an particular variable is executed results in some output. It appears i need to figure out which variable to debug, as well as the point where i should put the code


Was it helpful?

Solution

You can use this code in a phtml or php file and it will log the dump of $order->debug() in var/log/payment-method.log

$logger = new \Zend\Log\Logger();
$logger->addWriter(new \Zend\Log\Writer\Stream(BP.'/var/log/payment-method.log'));
$logger->debug(print_r($order->debug(),1));
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top