for 2.4.2 below code working
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('Custom message')
$logger->info(print_r($object->getData(), true));
for 2.4.2 above code working
$writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/custom.log');
$logger = new \Laminas\Log\Logger();
$logger->addWriter($writer);
$logger->info('text message');
Above solution not working in Magento 2.4.3 version anybody have an idea for the same
For 2.4.3?