|
|
|
@ -26,9 +26,12 @@ def init_app(app: DifyApp):
|
|
|
|
|
|
|
|
|
|
|
|
# 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,
|
|
|
|
|