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.
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-6283801390fd0523174208/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...