enhanced exception logging