skip to Main Content

Magento 2 old versions like magento 2.4.0 are accepted like taht

I found a solution to fixed custom log t Magento 2.4.3+++++:

$writer = new Zend_Log_Writer_Stream(BP . '/var/log/mycustom.log');
$logger = new Zend_Log();
$logger->addWriter($writer);
$logger->info("Its working successfully...");

I hove it will help for you!

2

Answers


  1. This will work with magento 2.4.5

    $writer = new Zend_Log_Writer_Stream(BP . '/var/log/custom.log');
    $logger = new Zend_Log();
    $logger->addWriter($writer);
    $logger->info('test');
    
    Login or Signup to reply.
  2. in root project.
    in composer.json file

    verify this:
    "require": {
    "zendframework/zend-log": "^2.13"
    }

    if not write this: composer require laminas/laminas-log

    https://docs.laminas.dev/laminas-log/installation/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search