Browse Source

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

tags/1.3.0
Ethan 6 months ago
parent
commit
523efbfea5
No account linked to committer's email address
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      api/extensions/ext_logging.py

+ 4
- 1
api/extensions/ext_logging.py View File



# Always add StreamHandler to log to console # Always add StreamHandler to log to console
sh = logging.StreamHandler(sys.stdout) sh = logging.StreamHandler(sys.stdout)
sh.addFilter(RequestIdFilter())
log_handlers.append(sh) log_handlers.append(sh)


# Apply RequestIdFilter to all handlers
for handler in log_handlers:
handler.addFilter(RequestIdFilter())

logging.basicConfig( logging.basicConfig(
level=dify_config.LOG_LEVEL, level=dify_config.LOG_LEVEL,
format=dify_config.LOG_FORMAT, format=dify_config.LOG_FORMAT,

Loading…
Cancel
Save