You can try:
OLD WAY
\Magento\Framework\App\ObjectManager::getInstance()
->get('Psr\Log\LoggerInterface')->debug(print_r(['a' => 'b'], true));
NEW WAY
STEP 1: Add object in construction()
public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Psr\Log\LoggerInterface $logger
) {
$this->_logger = $logger;
parent::__construct($context);
}
STEP :2 Use logger in function where you want
$this->_logger->addDebug("=======START ORDER======");
$this->_logger->addDebug(json_encode($order->getData()));
$this->_logger->addDebug("=======END ORDER======");