Omaha #4383 Improved logging in iscMosaic and iscDataRec

Change-Id: I2a93a46e6bb0db447ab722265f2cc14e3c957a69

Former-commit-id: 233bbf78a5 [formerly 28e7b70e9b8e495e22de71881ef9aa2932e8accf]
Former-commit-id: 9e7bb1053a
This commit is contained in:
Ron Anderson 2015-04-23 13:13:40 -05:00
parent 7c31c892fd
commit beb54304de
2 changed files with 10 additions and 7 deletions

View file

@ -22,7 +22,7 @@
## ##
import iscMosaic,iscUtil import iscMosaic,iscUtil
import os, stat, sys, re, string, traceback, types import os, stat, sys, re, string, types
import time, xml, LogStream, IrtAccess import time, xml, LogStream, IrtAccess
import IrtServer import IrtServer
from xml.etree import ElementTree from xml.etree import ElementTree
@ -46,6 +46,7 @@ from java.util import ArrayList
# 12/08/2014 4953 randerso Added support for sending/receiving TCV files # 12/08/2014 4953 randerso Added support for sending/receiving TCV files
# Additional code cleanup # Additional code cleanup
# 04/08/2015 4383 dgilling Support FireWx ISC. # 04/08/2015 4383 dgilling Support FireWx ISC.
# 04/23/2015 4383 randerso Fixed exception logging
# #
## ##
@ -78,7 +79,7 @@ def purgeFiles(msgid, files):
try: try:
os.remove(file) os.remove(file)
except: except:
logEvent("iscDataRec Failed to remove: ",file) logException("iscDataRec Failed to remove file %s: ", str(file))
def execIscDataRec(MSGID,SUBJECT,FILES): def execIscDataRec(MSGID,SUBJECT,FILES):
@ -109,7 +110,7 @@ def execIscDataRec(MSGID,SUBJECT,FILES):
destTree = ElementTree.ElementTree(ElementTree.XML(xmlFileBuf)) destTree = ElementTree.ElementTree(ElementTree.XML(xmlFileBuf))
iscE = destTree.getroot() iscE = destTree.getroot()
except: except:
logProblem("Malformed XML received") logException("Malformed XML received")
return return
#no XML destination information. Default to dx4f,px3 98000000, 98000001 #no XML destination information. Default to dx4f,px3 98000000, 98000001
@ -220,7 +221,8 @@ def execIscDataRec(MSGID,SUBJECT,FILES):
logEvent('Sent to:', logEvent('Sent to:',
irt.printServerInfo(destServer), "connectT=", delta1, "xmtT=", delta2) irt.printServerInfo(destServer), "connectT=", delta1, "xmtT=", delta2)
except: except:
logProblem("iscDataRec failed!",traceback.format_exc()) logException("iscDataRec failed!")
finally: finally:
# cleanup # cleanup
purgeFiles(MSGID, FILES) purgeFiles(MSGID, FILES)
@ -303,8 +305,8 @@ def main(argv):
execIscDataRec(MSGID,SUBJECT,FILES) execIscDataRec(MSGID,SUBJECT,FILES)
except: except:
logProblem('Failure:', traceback.format_exc()) logException('Failure:')
except: except:
logProblem("FAIL: ", traceback.format_exc()) logException("FAIL: ")

View file

@ -23,6 +23,7 @@
# ------------ ---------- ----------- -------------------------- # ------------ ---------- ----------- --------------------------
# 02/17/2015 4139 randerso Replaced call to iscTime.timeFromComponents # 02/17/2015 4139 randerso Replaced call to iscTime.timeFromComponents
# with call to calendar.timegm # with call to calendar.timegm
# 04/23/2015 4383 randerso Changed to log arguments to aid in troubleshooting
## ##
@ -521,9 +522,9 @@ class IscMosaic:
self.__processTimePeriod = (startTime, endTime) self.__processTimePeriod = (startTime, endTime)
initLogger(self.__logFile) initLogger(self.__logFile)
logger.info("iscMosaic Starting args: %s", str(args))
def execute(self): def execute(self):
logger.info("iscMosaic Starting")
# get the WxDefinition and DiscreteDefinition # get the WxDefinition and DiscreteDefinition
config = IFPServerConfigManager.getServerConfig(self.__mysite) config = IFPServerConfigManager.getServerConfig(self.__mysite)