And this logic needs to be changed:

- ``isset($record['context'])`` is not needed (it is already handled by the next isset check, and it always exists here)
- you need to check whether ``$record['context']['exception']`` is an Exception to avoid errors