While developing a module or working or customization developer frequently needs quick way to logs data or output

We can simply add below few lines to log data

$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/logfilename.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info(__FILE__);