From c5cfb5a424c39e91f1d97ed3f31405452c427dc4 Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Thu, 11 Sep 2025 22:28:55 +0800 Subject: [PATCH] feat(log): use str to ensure that class can be identified --- apps/notification/common/log/json_sink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/notification/common/log/json_sink.py b/apps/notification/common/log/json_sink.py index a798156..867ef42 100644 --- a/apps/notification/common/log/json_sink.py +++ b/apps/notification/common/log/json_sink.py @@ -81,5 +81,5 @@ class JsonSink: exc_type, exc_value, exc_tb = record["exception"] log_entry["stacktrace"] = traceback.format_exception(exc_type, exc_value, exc_tb) - self.log_file.write(json.dumps(log_entry, ensure_ascii=False) + "\n") + self.log_file.write(json.dumps(log_entry, ensure_ascii=False, default=str) + "\n") self.log_file.flush()