Add logging of exceptions