Ask your Question

Play online Skills Quiz

PEOPLE YOU MIGHT KNOW

Chris
Chris

Outlook Send Receive Error | How to fix it?

Alpharetta,  United States
io
io

top 10 BPO Services Provider Companies in Delhi

delhi,  India
digitalio
digitalio

delhi,  India
iodigital
iodigital

delhi,  India
io
io

top 10 BPO Services Provider Companies in Delhi

delhi,  India

Write to us

Ask Question

Create a custom log file in Magento 2

Create a custom log file in Magento 2

 

Create a custom log file in Magento 2 to log data .

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

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

$logger->addWriter($writer);

$logger->info("Data".$logmessage);

 

OR

protected $logger;

public function __construct(\Psr\Log\LoggerInterface $logger)

{  

    $this->logger = $logger;

  }

 $this->logger->info($logmessage);

 $this->logger->debug($logmessage);

0   0
Eecrets Magento

Related Post

List Your Business

Improve Your Business Visibility

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site