diff options
-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 |