I have created a new observer to check the order data passing with "sales_order_place_before" event in observer.My observer is working but when I am trying to fetch the observer event data am getting null values.Please help me resolve this issue.Thanks in advance. My observer file
namespace Custom\Order\Observer;
use Magento\Framework\Event\ObserverInterface;
class OrderPlacebefore implements ObserverInterface
{
protected $_objectManager;
public function __construct(
\Magento\Framework\ObjectManagerInterface $objectManager
) {
$this->_objectManager = $objectManager;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
$event = $observer->getEvent();
$orderObserverData = $observer->getEvent()->getData();
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info('mY obsever');
$logger->info('data' . json_encode($orderObserverData));
}
}