improved logging to provide more info about exceptions