dify icon indicating copy to clipboard operation
dify copied to clipboard

Celery worker log format not following "LOG_FORMAT" env

Open wy96f opened this issue 2 years ago • 2 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

0.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. do some operations about knowledge-base, e.g., delete dataset
  2. observe logs of dify-worker which don't follow "LOG_FORMAT" env

✔️ Expected Behavior

微信截图_20241016154817

These are logs of dify-app following “LOG_FORMAT” env.

❌ Actual Behavior

image

wy96f avatar Oct 16 '24 07:10 wy96f

The issue you're encountering seems to be that the Celery worker logs are not adhering to the LOG_FORMAT environment variable, unlike the logs from the main Dify application. This discrepancy might be due to how the logging is configured for the Celery worker.

In the Dify codebase, the LOG_FORMAT environment variable is used to configure the logging format in the main application through the logging.basicConfig function [1]. However, for the Celery worker, the logging configuration is set up using the --loglevel option in the exec command, which primarily sets the log level based on the LOG_LEVEL environment variable [2]. The LOG_FORMAT might not be explicitly applied to the Celery worker's logging setup.

To resolve this, you may need to modify the Celery worker's logging configuration to explicitly use the LOG_FORMAT environment variable. This could involve adjusting the Celery worker's startup script or configuration to ensure that the logging format is set according to your requirements.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Oct 16 '24 07:10 dosubot[bot]

Also 'LOG_TZ' is not following either

wy96f avatar Oct 29 '24 07:10 wy96f