diff -r 27780aa800d5 src/virt-manager.py.in
--- a/src/virt-manager.py.in	Mon Nov 12 13:04:59 2007 -0500
+++ b/src/virt-manager.py.in	Wed Nov 14 12:55:38 2007 -0500
@@ -123,6 +123,14 @@ def setup_logging():
     fileHandler.setFormatter(logging.Formatter(FILE_FORMAT, DATEFMT))
     rootLogger.addHandler(fileHandler)
     logging.info("Application startup")
+
+    # Log uncaught exceptions
+    def exception_log(type, val, tb):
+        import traceback
+        str = traceback.format_exception(type, val, tb)
+        logging.exception("".join(str))
+        sys.__excepthook__(type, val, tb)
+    sys.excepthook = exception_log
 
 def parse_commandline():
     optParser = OptionParser()
