Skip to content

Commit

Permalink
celery worker log format following LOG_FORMAT env#9404 (#10016)
Browse files Browse the repository at this point in the history
Signed-off-by: root <root@localhost.localdomain>
Co-authored-by: root <root@localhost.localdomain>
  • Loading branch information
liuhaoran1212 and root authored Nov 8, 2024
1 parent 888d7e6 commit 7c2a9b0
Show file tree
Hide file tree
Showing 3 changed files with 290 additions and 274 deletions.
6 changes: 6 additions & 0 deletions api/extensions/ext_celery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import timedelta

import pytz
from celery import Celery, Task
from celery.schedules import crontab
from flask import Flask
Expand Down Expand Up @@ -43,6 +44,11 @@ def __call__(self, *args: object, **kwargs: object) -> object:
result_backend=dify_config.CELERY_RESULT_BACKEND,
broker_transport_options=broker_transport_options,
broker_connection_retry_on_startup=True,
worker_log_format=dify_config.LOG_FORMAT,
worker_task_log_format=dify_config.LOG_FORMAT,
worker_logfile=dify_config.LOG_FILE,
worker_hijack_root_logger=False,
timezone=pytz.timezone(dify_config.LOG_TZ),
)

if dify_config.BROKER_USE_SSL:
Expand Down
Loading

0 comments on commit 7c2a9b0

Please sign in to comment.