Logging of uncaught exceptions to file