diff options
author | PrakashH <pbhandar@techmahindra.com> | 2019-01-31 06:27:40 +0000 |
---|---|---|
committer | PrakashH <pbhandar@techmahindra.com> | 2019-01-31 14:34:57 +0000 |
commit | 9557b8d53b11519b5d014f78cdd6ad5e92757cfc (patch) | |
tree | 36c8b57b5b78a6fee32b8e90c5207d91648a4d5b | |
parent | 5e4ea155f6766e19d245173a10d15ebe3618c9d1 (diff) |
Heartbeat Microservice Support
Heartbeat service monitors missing HB notification
Issue-ID: DCAEGEN2-267
Change-Id: I40a928fbf56164ec5288a4d489ffa10eee28e113
Signed-off-by: PrakashH <pbhandar@techmahindra.com>
-rw-r--r-- | miss_htbt_service/db_monitoring.py | 1 | ||||
-rw-r--r-- | miss_htbt_service/get_logger.py | 4 | ||||
-rw-r--r-- | miss_htbt_service/htbtworker.py | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/miss_htbt_service/db_monitoring.py b/miss_htbt_service/db_monitoring.py index b435f2a..3de43e3 100644 --- a/miss_htbt_service/db_monitoring.py +++ b/miss_htbt_service/db_monitoring.py @@ -147,6 +147,7 @@ def db_monitoring(current_pid,json_file,user_name,password,ip_address,port_num,d except(Exception) as err: msg='Json file process error : ', err _logger.error(msg) + continue hbc_pid, hbc_state, hbc_srcName, hbc_time = db.read_hb_common(user_name,password,ip_address,port_num,db_name) source_name = socket.gethostname() diff --git a/miss_htbt_service/get_logger.py b/miss_htbt_service/get_logger.py index e8d008c..7afbc92 100644 --- a/miss_htbt_service/get_logger.py +++ b/miss_htbt_service/get_logger.py @@ -18,6 +18,7 @@ import os import logging +import logging.handlers '''Configures the module root logger''' root = logging.getLogger() @@ -28,6 +29,9 @@ formatter = logging.Formatter('%(asctime)s | %(name)s | %(module)s | %(funcName) handler = logging.StreamHandler() handler.setFormatter(formatter) root.addHandler(handler) +fhandler = logging.handlers.RotatingFileHandler('./hb_logs.txt', maxBytes=(1048576*5), backupCount=10) +fhandler.setFormatter(formatter) +root.addHandler(fhandler) root.setLevel("DEBUG") class BadEnviornmentENVNotFound(Exception): diff --git a/miss_htbt_service/htbtworker.py b/miss_htbt_service/htbtworker.py index 6dbd6cd..dc770fc 100644 --- a/miss_htbt_service/htbtworker.py +++ b/miss_htbt_service/htbtworker.py @@ -71,7 +71,7 @@ def process_msg(jsfile,user_name, password, ip_address, port_num, db_name): msg="\n\nHBT:eventnameList values ", eventnameList _logger.info(msg) if "groupID" not in os.environ or "consumerID" not in os.environ: - get_url = mr_url + 'DefaultGroup/1?timeout=15000' + get_url = mr_url + '/DefaultGroup/1?timeout=15000' else: get_url = mr_url + '/' + os.getenv('groupID', "") + '/' + os.getenv('consumerID', "") + '?timeout=15000' msg="HBT:Getting :"+get_url |