1<?php
2 $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/MYLOGFILE.log');
3 $logger = new \Zend\Log\Logger();
4 $logger->addWriter($writer);
5 $logger->info('Your text message');
6?>
1<?php
2 $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/logfile.log');
3 $logger = new \Zend\Log\Logger();
4 $logger->addWriter($writer);
5 $logger->info('Simple Text Log'); // Simple Text Log
6 $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
7?>
1$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
2$logger = new \Zend\Log\Logger();
3$logger->addWriter($writer);
4$logger->info('Your text message');
5
1Mage::log('message',null,'logfile.log',true);
2Mage::log(print_r($arr, 1), null, 'logfile.log',true);
1\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug('Your message here');