From f9607f38c1be8edff5a0382a40b96140a057102d Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Mon, 13 Jan 2025 23:18:52 +0800 Subject: [PATCH] fix: fix the formatter is not applied on log file --- api/extensions/ext_logging.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/extensions/ext_logging.py b/api/extensions/ext_logging.py index 1b9e78828db0e5..bf9b492a506970 100644 --- a/api/extensions/ext_logging.py +++ b/api/extensions/ext_logging.py @@ -27,12 +27,11 @@ def init_app(app: DifyApp): # Always add StreamHandler to log to console sh = logging.StreamHandler(sys.stdout) sh.addFilter(RequestIdFilter()) - log_formatter = logging.Formatter(fmt=dify_config.LOG_FORMAT) - sh.setFormatter(log_formatter) log_handlers.append(sh) logging.basicConfig( level=dify_config.LOG_LEVEL, + format=dify_config.LOG_FORMAT, datefmt=dify_config.LOG_DATEFORMAT, handlers=log_handlers, force=True,