How to Print Log data in file?

How to Print Log data in file?

Just add this code in file where u want to print log data

code:

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/order-log.log');

$templogger = new \Zend\Log\Logger();

$templogger->addWriter($writer);

$templogger->info(print_r($var, 1));



Copyright © 2024 Tridhya Tech Limited, Inc. All rights reserved.