• Bilal Malik

How to write custom logs in Magento 2

We can use the below functions to anywhere like Models, Helper, Controller..etc and call wherever you need to print logs.

public function culog($msg) {
$writer = new \Zend\Log\Writer\Stream ( BP . '/var/log/pdp.log' );
$logger = new \Zend\Log\Logger ();
$logger->addWriter ( $writer );
$logger->info ( print_r ( $msg, true ) );
}

7 views

Recent Posts

See All

What is requireJS AMD in Magento2

Simply we can say, below format is the AMD module. define(['jquery'] , function ($) { return function () {}; }); Module Vs AMD module 1. Javascript Module Pattern (function () { this.myGlobal =

©2020 by Bilal Usean. Proudly created with Wix.com