From 8d7c0201456b7f9af6e91fea90354f4c3de323fe Mon Sep 17 00:00:00 2001 From: Satoshi Fujii Date: Fri, 22 Oct 2021 12:30:45 +0000 Subject: Fix log rotation issue Writing log to a single file from multiple processes is not supported by python logging. It causes making fragmented log files at log rotation and logs are mixed up. This change is to use different log files for each sub-process to help developers check log for a specific process easily. This change does not affect to pod log (stdout log). Signed-off-by: Satoshi Fujii Issue-ID: DCAEGEN2-2941 Change-Id: If8bcb2308863d1395a2c547d2e7b746301665fb0 --- miss_htbt_service/cbs_polling.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'miss_htbt_service/cbs_polling.py') diff --git a/miss_htbt_service/cbs_polling.py b/miss_htbt_service/cbs_polling.py index 3832b71..e7bdef1 100644 --- a/miss_htbt_service/cbs_polling.py +++ b/miss_htbt_service/cbs_polling.py @@ -22,7 +22,7 @@ # CBS Polling # Set the hb_common table with state="RECONFIGURATION" periodically # to get the new configuration downloaded - +import logging import sys import os import socket @@ -30,7 +30,7 @@ import time import misshtbtd as db import get_logger -_logger = get_logger.get_logger(__name__) +_logger = logging.getLogger(__name__) def poll_cbs(current_pid: int) -> None: @@ -60,6 +60,7 @@ def poll_cbs(current_pid: int) -> None: def cbs_polling_loop(current_pid: int): + get_logger.configure_logger('cbs_polling') while True: poll_cbs(current_pid) -- cgit 1.2.3-korg