If you want to print your code log in the custom log file, then use the below mention code to print the log in the custom log file.
1 2 3 4 5 6 7 8 9 10 |
$StringVar = 'Magemonkeys'; $ArrayVar = array('Magemonkeys', 'Abbacus'); $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/CustomFileName.log'); $logger = new \Zend\Log\Logger(); $logger->addWriter($writer); $logger->info('Lorem ipsum dolor sit amet...'); // For print simple text in custom log file $logger->info($StringVar); // For print string in custom log file $logger->info(print_r($ArrayVar, true)); // For print array in custom log file |
That’s it.
Refresh your page and see your custom log file in Magento /var/log directory. Hope that helps.
[crayon-63e09db80db02372889507/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.