aboutsummaryrefslogtreecommitdiffstats
path: root/miss_htbt_service/get_logger.py
diff options
context:
space:
mode:
authorPrakashH <pbhandar@techmahindra.com>2019-01-31 19:34:38 +0000
committerPrakashH <pbhandar@techmahindra.com>2019-01-31 19:34:38 +0000
commit235db9ca1ded4f36284108e8f95c6abe64bcd462 (patch)
tree59d2b62b917ae93ca8c1bc8a0a05df9c450a5b09 /miss_htbt_service/get_logger.py
parentfde3682c0073d6d8c57acd7d95850f166a190868 (diff)
Heartbeat Microservice CL-OUT supportves-cl-outputsupport
Support the control loop having heartbeat event Issue-ID: DCAEGEN2-1138 Change-Id: I14f4d6bb723794450fbaf3c86f063148364bc023 Signed-off-by: PrakashH <pbhandar@techmahindra.com>
Diffstat (limited to 'miss_htbt_service/get_logger.py')
-rw-r--r--miss_htbt_service/get_logger.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/miss_htbt_service/get_logger.py b/miss_htbt_service/get_logger.py
index e8d008c..3e474cd 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,10 @@ formatter = logging.Formatter('%(asctime)s | %(name)s | %(module)s | %(funcName)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
root.addHandler(handler)
+if(os.getenv('pytest', "") != 'test'):
+ fhandler = logging.handlers.RotatingFileHandler('./hb_logs.txt', maxBytes=(1048576*5), backupCount=10)
+ fhandler.setFormatter(formatter)
+ root.addHandler(fhandler)
root.setLevel("DEBUG")
class BadEnviornmentENVNotFound(Exception):