Added exception logging capabilities