Use exc_info for logging where possible