diff --git a/src/otaclient_iot_logging_server/aws_iot_logger.py b/src/otaclient_iot_logging_server/aws_iot_logger.py index ad1d759..d3f8c97 100644 --- a/src/otaclient_iot_logging_server/aws_iot_logger.py +++ b/src/otaclient_iot_logging_server/aws_iot_logger.py @@ -73,9 +73,6 @@ def __init__( # will definitely have entries less than MAX_LOGS_PER_PUT self._max_logs_per_merge = min(max_logs_per_merge, self.MAX_LOGS_PER_PUT) - # unconditionally create log_group and log_stream, do nothing if existed. - self._create_log_group() - @retry(max_retry=16, backoff_factor=2, backoff_max=32) def _create_log_group(self): # TODO: (20240214) should we let the edge side iot_logging_server @@ -181,6 +178,9 @@ def send_messages(self, log_stream_name: str, message_list: list[LogMessage]): def thread_main(self) -> NoReturn: """Main entry for running this iot_logger in a thread.""" + # unconditionally create log_group and log_stream, do nothing if existed. + self._create_log_group() + while True: # merge LogMessages into the same source, identified by # log_stream_suffix.