Pages

Magento 2.3 : Generate Custom Log

Following code return custom log,

             $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log');  
             $logger = new \Zend\Log\Logger();  
             $logger->addWriter($writer);  
             $logger->info('Your log details: ' .$your_variable);  

No comments:

Post a Comment