类似的问题似乎都基于使用自定义记录器,我很高兴只使用默认/无。我的pika python应用程序运行并接收消息,但在几秒钟后崩溃No handlers could be found for logger "pika.adapters.blocking_connection"
,有什么想法?没有处理程序可以发现记录“pika.adapters.blocking_connection”
import pika
credentials = pika.PlainCredentials('xxx_apphb.com', 'xxx')
parameters = pika.ConnectionParameters('bunny.cloudamqp.com', 5672, 'xxx_apphb.com', credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
channel.queue_declare('messages')
def message_received(channel, method, properties, body):
print "[x] Received %r" % (body)
channel.basic_consume(message_received, queue='messages', no_ack=True)
channel.start_consuming()
固定加:
import logging
logging.basicConfig()
我从CentOS 5升级到CentOS 6时遇到了类似的问题,我的问题是我的兔子服务被杀掉了。我不得不从inittab改变为initctl来启动我的python脚本,在这之后兔子并没有死亡。想像我会分享我的评论,以防万一它帮助任何人。 –