Log exceptions and their messages when a job fails.