Improve logging format for exceptions.