Django和芹菜日志

发布于 2025-02-12 09:35:23 字数 532 浏览 1 评论 0 原文

我们有一个Django应用程序(带有芹菜),该应用程序每分钟处理数万个HTTP请求。 获得了大量日志,

ip... - - [date...] "POST /url... HTTP/1.0" 200 311 "-" "libcurl-agent/1.0"

我们从django喜欢的大量日志和芹菜的日志中

INFO:celery.worker.strategy:Task backend.tasks.my_task_name[62c288f0-63ad-45b5-8abd-bbfe11a8b612] received
INFO:celery.app.trace:Task backend.tasks.my_task_name[c633ad89-9e2c-4622-bf50-077d8dcf61b6] succeeded in 0.008994809817522764s: None

例如我该如何限制这些日志? 我想知道该应用程序有效。另一方面,它太多的日志数据。 我可以设置诸如每秒5个日志行不再排除错误之类的东西吗?

We have a Django app (with Celery) that process several tens of thousands of http requests per minute.
We are getting a huge volume of logs from Django like

ip... - - [date...] "POST /url... HTTP/1.0" 200 311 "-" "libcurl-agent/1.0"

and logs from Celery like

INFO:celery.worker.strategy:Task backend.tasks.my_task_name[62c288f0-63ad-45b5-8abd-bbfe11a8b612] received
INFO:celery.app.trace:Task backend.tasks.my_task_name[c633ad89-9e2c-4622-bf50-077d8dcf61b6] succeeded in 0.008994809817522764s: None

How can I limit these logs?
From one side I want to know that the app works. On another side, it is too much log data.
Can I set something like store no more 5 log lines per second exclude errors?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林散布 2025-02-19 09:35:23

听起来您需要检查项目中芹菜的设置方式。我不知道您的源代码,但这是

Sounds like you need to check how the Celery is setup in your project. I don't know your source code, but here is a good article on some good practices with django and celery

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文