Answers for "magento 2 write to log file"

PHP
-1

magento 2 custom logging

$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 July-01-2020
0

mage log equivalent magento 2

\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug('Your message here');
Posted by: Guest on August-19-2020

Browse Popular Code Answers by Language