How to log an exception?

Interface

Implementation

Details: How does \Magento\Framework\Logger\Monolog::critical() work?

A usage example