Index: trunk/src/python/unifiedlogger/cad_watcher.py
===================================================================
--- trunk/src/python/unifiedlogger/cad_watcher.py	(revision 466)
+++ trunk/src/python/unifiedlogger/cad_watcher.py	(revision 467)
@@ -1,3 +1,3 @@
-import json, time, ConfigParser
+import json, time, ConfigParser, os
 from copy import deepcopy
 
@@ -18,21 +18,4 @@
     return not isEmpty(cmsitem)
 
-# Read the cad comments log 
-def readFile():
-    # get path to input file from configuration
-    config = ConfigParser.ConfigParser()
-    config.read('config/logging_service.cfg')
-    logfilepath  = config.get('Paths', 'UnifiedLogPath')
-    
-    lines = []
-    try:
-        text_file = open(logfilepath + "CADcomments.log", "r")
-    except IOError:
-        print "Error: missing "+logfilepath+"CADcomments.log file."
-    else:
-        lines = text_file.read().split('\n')
-        text_file.close()    
-    return lines
-    
 def setup():
     lastLineNum = 0
@@ -42,9 +25,36 @@
 def getLogEntries():
     global lastLineNum
-    msgList = readFile()
-    currList = []
-    currList = msgList[lastLineNum:]    # new items since last file read
-    lastLineNum = len(msgList)-1
-    return currList
+    # get path to input file from configuration
+    config = ConfigParser.ConfigParser()
+    config.read('config/logging_service.cfg')
+    logfilepath  = config.get('Paths', 'UnifiedLogPath')
+    pathToLog = logfilepath + "CADcomments.log"
+    
+    try:
+        text_file = open(pathToLog, "r")
+    except IOError as ex:
+        if ex.errno == 2:
+            # 'No such file or directory
+            print pathToLog + " missing: assuming reset"
+            lastLineNum = 0   #Start over
+            return []
+        else:
+            print "IOError reading "+pathToLog+" file."
+            print "errno: ",ex.errno
+            
+    else:
+        # Check file size
+        fileSize = os.path.getsize(pathToLog)
+        if fileSize == 0:
+            # Assume this is a read sync problem: Don't modify lastLineNum
+            print pathToLog+" is empty."
+            return []
+        else: # file is good, read it.
+            msgList = text_file.read().split('\n')
+            text_file.close()
+            currList = []
+            currList = msgList[lastLineNum:] # new items since last file read
+            lastLineNum = len(msgList)-1
+            return currList
 
 # Local main for unit testing
