import logging
logging.basicConfig(
filename="./log.txt",
filemode="a",
format="%(levelname)s;%(asctime)s;%(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
level=logging.INFO)
Но логирует и pika и торнадо. Как перестать это все логировать? Хорошо бы, чтобы наоборот в консоль выводилось.
INFO;2021-09-12 18:13:18;Pika version 1.2.0 connecting to ('172.30.0.2', 5672)
INFO;2021-09-12 18:13:18;Socket connected: <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.30.0.5', 37154), raddr=('172.30.0.2', 5672)>
INFO;2021-09-12 18:13:18;Streaming transport linked up: (<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f7166cd3100>, _StreamingProtocolShim: <SelectConnection PROTOCOL transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f7166cd3100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>).
INFO;2021-09-12 18:13:18;AMQPConnector - reporting success: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f7166cd3100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 18:13:18;AMQPConnectionWorkflow - reporting success: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f7166cd3100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 18:13:18;Connection workflow succeeded: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7f7166cd3100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 18:13:18;Created channel=1
INFO;2021-09-12 18:13:52;101 GET /ws (172.30.0.6) 0.45ms
INFO;2021-09-12 18:14:25;101 GET /ws (172.30.0.6) 0.41ms
INFO;2021-09-12 18:16:59;101 GET /ws (172.30.0.6) 0.38ms
INFO;2021-09-12 18:18:46;101 GET /ws (172.30.0.6) 0.38ms
INFO;2021-09-12 19:45:13;MQ: Connect guest rabbitmq:5672
INFO;2021-09-12 19:45:13;Pika version 1.2.0 connecting to ('172.30.0.2', 5672)
INFO;2021-09-12 19:45:13;Socket connected: <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.30.0.5', 49150), raddr=('172.30.0.2', 5672)>
INFO;2021-09-12 19:45:13;Streaming transport linked up: (<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7fae23aee100>, _StreamingProtocolShim: <SelectConnection PROTOCOL transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7fae23aee100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>).
INFO;2021-09-12 19:45:13;AMQPConnector - reporting success: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7fae23aee100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 19:45:13;AMQPConnectionWorkflow - reporting success: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7fae23aee100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 19:45:13;Connection workflow succeeded: <SelectConnection OPEN transport=<pika.adapters.utils.io_services_utils._AsyncPlaintextTransport object at 0x7fae23aee100> params=<ConnectionParameters host=rabbitmq port=5672 virtual_host=/ ssl=False>>
INFO;2021-09-12 19:45:13;Created channel=1