def appendTimeLog(self, name, runtime, severity): msg = Constants.toStringRuntime(name, Constants.RUNTIME, runtime, severity) try: self.appendLog(msg, severity) except Exception as error: monitorLog.logError("Failure to append Count Log: " + msg, `error`) raise Exception("Failure to append Count log: " + msg)
def appendCountLog(self, name, count, severity): msg = Constants.toStringCount(name, Constants.COUNT, count, severity) try: self.appendLog(msg, severity) except Exception as error: monitorLog.logError("Failure append Count Log: " + msg, `error`) raise Exception("Failure to append Count log: " + msg)
def __init__ (self, service): self.handler = Handler(service) self.logger = self.handler.getLogHandler() # get queue handler for logging self.queueHandler = self.handler.getQueueHandler() # start queue subscriber for logging self.handler.startQueueSubscriber() self.service = service self.setHost() self.setZone() self.setRegion() self.commonLog = Constants.toStringCommon(self.region, self.zone, self.host, self.service)
def __init__ (self, service, configFile): self.service = service try: self.handler = Handler(self.service, configFile) self.logger = self.handler.getLogHandler() print "handler returned logger instance" except Exception as error: monitorLog.logError("Cannot Instantiate Handler with configFile : " + configFile, `error`) raise Exception("Cannot Instantiate Handler with configFile : " + configFile) ''' Subscriber is now an independent process , hence following lines are commented ''' # start queue subscriber for logging #self.handler.startQueueSubscriber() # get queue handler for logging try: self.queueHandler = self.handler.getQueueHandler() except Exception as error: monitorLog.logError("Cannot instanstiate ZMQ handler with given context", `error`) raise Exception("Cannot instanstiate ZMQ handler with given context") self.commonLog = Constants.toStringCommon(service)
def appendTimeLog(self, name, metricType, runtime): msg = Constants.toStringRuntime(name, metricType, runtime) self.appendLog(msg)
def appendCountLog(self, name, metricType, count): msg = Constants.toStringCount(name, metricType, count) self.appendLog(msg)