mage log magento 2
snippet in php

magento2 zend log

user6419

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

user8260

<?php
  $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/logfile.log');
  $logger = new \Zend\Log\Logger();
  $logger->addWriter($writer);
  $logger->info('Simple Text Log'); // Simple Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>

mage log equivalent magento 2

user8265

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