From d626a0631a4ee65c3eba148df3306589d0f5a440 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sun, 14 Jun 2026 19:06:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20RotatingFileHandler=E5=BC=BA=E5=88=B6UTF?= =?UTF-8?q?-8=E7=BC=96=E7=A0=81=E9=81=BF=E5=85=8DWindows=20GBK=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/log_service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/log_service.py b/services/log_service.py index 09bf231..c44e6c1 100644 --- a/services/log_service.py +++ b/services/log_service.py @@ -89,7 +89,8 @@ class LogService: runtime_handler = logging.handlers.RotatingFileHandler( self.log_dir / "runtime" / runtime_log_file, maxBytes=self._parse_size(self.config['logging'].get('max_file_size', '10MB')), - backupCount=self.config['logging'].get('max_log_files', 3) + backupCount=self.config['logging'].get('max_log_files', 3), + encoding='utf-8' ) runtime_handler.setLevel(getattr(logging, self.config['logging']['level'], logging.INFO)) runtime_handler.setFormatter(file_formatter) @@ -101,7 +102,8 @@ class LogService: debug_handler = logging.handlers.RotatingFileHandler( self.log_dir / "debug" / debug_log_file, maxBytes=self._parse_size(self.config['logging'].get('max_file_size', '10MB')), - backupCount=self.config['logging'].get('max_log_files', 3) + backupCount=self.config['logging'].get('max_log_files', 3), + encoding='utf-8' ) debug_handler.setLevel(logging.DEBUG) debug_handler.setFormatter(file_formatter)