add logs for proxy timeout exception

This commit is contained in:
2022-04-04 19:17:10 +02:00
parent 75b0ba8582
commit 62e1dd1106
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -45,6 +45,9 @@ class LogSender:
msg = "{}, email: {}".format(result.message, result.email)
self.send_log(msg, type=LOG_APPOINTMENT_ERROR)
def send_error(self, msg: str):
self.send_log(msg=msg, type=LOG_ERROR)
def send_log(self, msg: str, source=definitions.LOG_SOURCE, subject="appointment", type: str = "INFO"):
log_id = "ocid1.log.oc1.eu-frankfurt-1.amaaaaaas4ft22ya3ub6glkltqqbnmkxo3ui7xwq3dxtjd2scdhme4deyu2q"
response = self._loggingingestion_client.put_logs(
@@ -78,6 +81,7 @@ class LogSender:
def send_wait_sms_log(self):
self.send_log("等待短信", subject=LOG_SUBJECT_EVENT, type=TYPE_SMS_RECEIVED)
if __name__ == '__main__':
init_logger()
logger = logging.getLogger()