Magento2 Zend Log

magento2 zend log
<?php
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/MYLOGFILE.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
?>
mage log equivalent magento 2
\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug('Your message here');

Leave a Comment