Index: trunk/src/python/unifiedlogger/cad_watcher.py
===================================================================
--- trunk/src/python/unifiedlogger/cad_watcher.py	(revision 687)
+++ trunk/src/python/unifiedlogger/cad_watcher.py	(revision 689)
@@ -32,6 +32,6 @@
     except IOError as ex:
         if ex.errno == 2:
-            # 'No such file or directory'
-            # Assume this is a read sync problem: Don't modify lastLineNum
+            # 'No such file or directory' - could be system was restarted or
+            # this is a read sync problem: Don't modify lastLineNum
             print pathToLog + " missing, skipping file read."
             #lastLineNum = 0   #Start over
@@ -45,6 +45,8 @@
         fileSize = os.path.getsize(pathToLog)
         if fileSize == 0:
-            print pathToLog+" is empty, skipping file read and resetting."
-            lastLineNum = 0   #Start over
+            # Assume this is a read sync problem: Don't modify lastLineNum
+            # because once the file is synced it will have same # of lines.
+            print pathToLog+" is empty, skipping file read."
+            #lastLineNum = 0   #Start over
             return []
         else: # file is good, read it.
@@ -52,4 +54,9 @@
             text_file.close()
             currList = []
+            # If the system restarted there is usually fewer lines in the file
+            # than lastLineNum, so assume all lines are new and reset lastLineNum
+            if len(msgList) < lastLineNum:
+                print pathToLog + " has few lines than expected, assuming restart."
+                lastLineNum = 0
             currList = msgList[lastLineNum:] # new items since last file read
             lastLineNum = len(msgList)
