Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celery worker log format following LOG_FORMAT env#9404 #10016

Merged
merged 10 commits into from
Nov 8, 2024
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