“Log Magento 1” Kode Jawaban

mage log magento 2

<?php /* for Magento 2.4 */
  $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/custom.log');
  $logger = new \Zend_Log();
  $logger->addWriter($writer);
  $logger->info('Text Log'); //Text Log
  $logger->info('Array Log'.print_r($myArrayVar, true)); // Array Log
?>
<?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
?>
  
Itchy Ibex

Logger magento2

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
Defeated Dog

Log Magento 1

Mage::log('message',null,'logfile.log',true);
Mage::log(print_r($arr, 1), null, 'logfile.log',true);
Colorful Corncrake

Log Magento 1

Mage::log('message',null,'nam.log',true);
Cooperative Cheetah

Mage Log Eqivalent Magento 2

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

Jawaban yang mirip dengan “Log Magento 1”

Pertanyaan yang mirip dengan “Log Magento 1”

Lebih banyak jawaban terkait untuk “Log Magento 1” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya