Sometimes when we are troubleshooting, we might need to generate logs to see what values are returning in a special code.
For this we can use Zend library, which helps in creating the logs and thereby we can identify the things we need to know.
For this we can use Zend library, which helps in creating the logs and thereby we can identify the things we need to know.
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/customlog.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Your text message');
If its an array, we can use$logger->info(print_r($yourArray, true));
No comments:
Post a Comment