Answers for "log object magento2"

PHP
7

mage log magento 2

<?php
  $writer = new ZendLogWriterStream(BP . '/var/log/logfile.log');
  $logger = new ZendLogLogger();
  $logger->addWriter($writer);
  $logger->info('Simple Text Log'); // Simple Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>
Posted by: Guest on December-22-2020
0

log magento 1

Mage::log('message',null,'nam.log',true);
Posted by: Guest on January-13-2022
0

mage log equivalent magento 2

MagentoFrameworkAppObjectManager::getInstance()->get(PsrLogLoggerInterface::class)->debug('Your message here');
Posted by: Guest on August-19-2020

Browse Popular Code Answers by Language