“mago log equivalente a magento 2” Respostas de código

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');
?>
Excited Elk

mago 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

mago log equivalente a magento 2

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

Respostas semelhantes a “mago log equivalente a magento 2”

Perguntas semelhantes a “mago log equivalente a magento 2”

Mais respostas relacionadas para “mago log equivalente a magento 2” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código