Answers for "magento2 2.4 how to log"

PHP
1

logger magento2

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
Posted by: Guest on June-08-2021
3

log magento 1

Mage::log('message',null,'logfile.log',true);
Mage::log(print_r($arr, 1), null, 'logfile.log',true);
Posted by: Guest on January-25-2021

Browse Popular Code Answers by Language