错误消息“找不到记录器“多处理”的处理程序”使用芹菜

发布于 2024-11-14 01:18:54 字数 1166 浏览 6 评论 0原文

RabbitMQ 现在似乎工作正常。但是,当我尝试时

python -m celery.bin.celeryd --loglevel=INFO` 

(常规 celeryd 不起作用),我收到错误

找不到记录器“多处理”的处理程序`)。

这是完整的输出(稍作编辑):

[2011-06-06 02:08:08,105: WARNING/MainProcess] -------------- celery@blahblah v2.2.6
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** ---   . broker:      amqplib://blah@localhost:5672/vhost
- ** ----------   . loader:      celery.loaders.default.Loader
- ** ----------   . logfile:     [stderr]@INFO
- ** ----------   . concurrency: 2
- ** ----------   . events:      OFF
- *** --- * ---   . beat:        OFF
-- ******* ----
--- ***** ----- [Queues]
 --------------   . celery:      exchange:celery (direct) binding:celery


[Tasks]
  . tasks.add
[2011-06-06 02:08:08,812: WARNING/MainProcess] celery@blahblah has started
.
No handlers could be found for logger "multiprocessing"
No handlers could be found for logger "multiprocessing"

我真的很想正确设置它,这样我就可以继续将它与 Django 一起使用!

(这不是我的第一个找不到处理程序错误,但我在网上找不到与此相关的任何内容......)

RabbitMQ now seems to be working correctly. However, when I try

python -m celery.bin.celeryd --loglevel=INFO` 

(regular celeryd doesn't work), I get the error

No handlers could be found for logger "multiprocessing"`).

Here's the full output (redacted slightly):

[2011-06-06 02:08:08,105: WARNING/MainProcess] -------------- celery@blahblah v2.2.6
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** ---   . broker:      amqplib://blah@localhost:5672/vhost
- ** ----------   . loader:      celery.loaders.default.Loader
- ** ----------   . logfile:     [stderr]@INFO
- ** ----------   . concurrency: 2
- ** ----------   . events:      OFF
- *** --- * ---   . beat:        OFF
-- ******* ----
--- ***** ----- [Queues]
 --------------   . celery:      exchange:celery (direct) binding:celery


[Tasks]
  . tasks.add
[2011-06-06 02:08:08,812: WARNING/MainProcess] celery@blahblah has started
.
No handlers could be found for logger "multiprocessing"
No handlers could be found for logger "multiprocessing"

I'd really like to get this set up properly, so I can move on to using it with Django!

(It is not my first no handlers found error, but I'm having trouble finding anything on the web regarding this...)

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

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

发布评论

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

评论(3

忆依然 2024-11-21 01:18:55

您需要确保从主进程启动的所有进程也正确设置日志记录。 这是一篇文章,讨论如何最好地进行日志记录多处理。尽管这里讨论的是 Python 3.2 中的功能,但您也可以为早期的 Python 版本获取此功能 - 请参阅 另一篇文章

更新:重点是每个进程都需要初始化日志记录,并且您需要在代码中进行安排,与第一篇文章中的示例中的操作类似:请参阅Listener_configurerworker_configurer。您可以使用 logutils 来帮助您,但主要的是要意识到每个进程都需要配置日志记录,如果您想避免出现“找不到处理程序”消息。

You need to ensure that all processes started from the main process also set up logging correctly. Here's a post which discusses how best to do logging with multiprocessing. Though that discusses features with came in with Python 3.2, you can also get this functionality for earlier Python versions - see this other post.

Update: The point is that each process needs to initialise logging, and you need to arrange this in your code, in a similar way to what is done in the example in the first post: see listener_configurer and worker_configurer. You can use logutils to help you, but the main thing is to realise that each process needs to configure logging, if you are to avoid that "no handlers could be found" message.

帝王念 2024-11-21 01:18:55

芹菜初始化日志记录的方式似乎有些奇怪。如果我将开关 --logfile=yourfile.log 放在命令行上,它可以可靠地工作,但是从配置中读取日志记录会给出不可靠的结果,包括您所看到的内容。

There seems to be something strange in the way celery initializes logging. If I put the switch --logfile=yourfile.log on the command-line, it works reliably, but reading the logging from the config gives unreliable results including the stuff you're seeing.

北渚 2024-11-21 01:18:55

确保日志文件目录存在,并且进程对该日志目录有写权限。

我遇到了类似的问题,创建日志文件位置目录后问题就消失了。

Make sure the log file directory exists the and processes has write permission to the log directory.

I faced similar issue , after creating log file location directory the problem went away.

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