Magento 2 one line debug command

\Magento\Framework\App\ObjectManager::getInstance()
    ->get(\Psr\Log\LoggerInterface::class)->debug('message');

For custom .log file:

                $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/debugSql.log');
                $logger = new \Zend_Log();
                $logger->addWriter($writer);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.