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

fix: fix the formatter is not applied on log file #12704

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acelyc111
Copy link
Contributor

@acelyc111 acelyc111 commented Jan 13, 2025

Summary

Fixes #12744.

In #11599, the patch removed the formatter from basicConfig and added it only to the stdout, however, the log file requires formatter as well. This patch adds the formatter back.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

In log files:

Before:

INFO:root:Loaded ext_storage (364.46 ms)
INFO:root:Loaded ext_celery (1.46 ms)
INFO:root:Loaded ext_login (0.01 ms)
INFO:root:Skipped ext_mail
INFO:root:Loaded ext_hosting_provider (0.0 ms)
INFO:root:Loaded ext_sentry (0.0 ms)
INFO:root:Loaded ext_proxy_fix (0.0 ms)
INFO:root:Loaded ext_blueprints (373.1 ms)
INFO:root:Loaded ext_commands (1.6 ms)
INFO:root:Finished create_app (11808.69 ms)
INFO:werkzeug:�[31m�[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.�[0m
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5001
 * Running on http://x.x.x.x:5001
INFO:werkzeug:�[33mPress CTRL+C to quit�[0m

After:

2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:90] - Loaded ext_celery (2.81 ms)
2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:90] - Loaded ext_login (0.02 ms)
2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:83] - Skipped ext_mail
2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:90] - Loaded ext_hosting_provider (0.01 ms)
2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:90] - Loaded ext_sentry (0.0 ms)
2025-01-14 23:45:21,637.637 INFO [MainThread] [app_factory.py:90] - Loaded ext_proxy_fix (0.0 ms)
2025-01-14 23:45:22,001.001 INFO [MainThread] [app_factory.py:90] - Loaded ext_blueprints (364.07 ms)
2025-01-14 23:45:22,003.003 INFO [MainThread] [app_factory.py:90] - Loaded ext_commands (1.27 ms)
2025-01-14 23:45:22,003.003 INFO [MainThread] [app_factory.py:28] - Finished create_app (6042.56 ms)
2025-01-14 23:45:22,008.008 INFO [MainThread] [_internal.py:97] - �[31m�[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.�[0m
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5001
 * Running on http://x.x.x.x:5001
2025-01-14 23:45:22,008.008 INFO [MainThread] [_internal.py:97] - �[33mPress CTRL+C to quit�[0m

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Jan 13, 2025
@crazywoola
Copy link
Member

Hello please link an existing issue or open a new issue.

@acelyc111
Copy link
Contributor Author

Hello please link an existing issue or open a new issue.

Done

@crazywoola
Copy link
Member

@luckylhb90 Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing the date field in log file content
2 participants