We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    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.

    $StringVar = 'Magemonkeys';
    $ArrayVar = array('Magemonkeys', 'Abbacus');
    
    $writer = new ZendLogWriterStream(BP . '/var/log/CustomFileName.log');
    $logger = new ZendLogLogger();
    $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.

    Fill the below form if you need any Magento relate help/advise/consulting.

    With Only Agency that provides a 24/7 emergency support.

      Get a Free Quote