Add logging for exception