Enhance exception logging