Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix: ValueError: Formatting field not found in record: 'req_id' (#18327)

Ethan523efbfea557
diff --git a/api/extensions/ext_logging.py b/api/extensions/ext_logging.py
index 422ec877656..aa55862b7ce 100644
--- a/api/extensions/ext_logging.py
+++ b/api/extensions/ext_logging.py
@@ -26,9 +26,12 @@ def init_app(app: DifyApp):
# Always add StreamHandler to log to console
sh = logging.StreamHandler(sys.stdout)
- sh.addFilter(RequestIdFilter())
log_handlers.append(sh)
+ # Apply RequestIdFilter to all handlers
+ for handler in log_handlers:
+ handler.addFilter(RequestIdFilter())
+
logging.basicConfig(
level=dify_config.LOG_LEVEL,
format=dify_config.LOG_FORMAT,