magento2 zend log
snippet in php

magento2 zend log

user521

<?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

user2215

\Magento\Framework\App\ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class)->debug('Your message here');