Closed davetapley closed 1 year ago
The arg name is interface_or_socket
, so you should be able to use that. I'll do a PR that allows socket
as a kwarg.
I really wonder why I've gotten so many reports about issues in zmq.log in the past few weeks, when it largely hasn't been worked on since 2014. Can I ask where you got the idea to use it?
Ah I can't believe I didn't see that, yep interface_or_socket
works as expected.
I think just complete coincidence for me: working on new project since Jan and ZMQ + Python seemed natural fit.
A few weeks ago it dawned on me I could use ZMQ for log transport, and was pleased to find PUBHandler
when I Googled "zmq logging" 😁
Fair enough! What do you think about #1840 - which enables socket
as kwarg at the expense of some complexity?
I feel bad you did the work, but yeah I think extra kwarg is overkill when interface_or_socket
works correctly.
Perhaps could put dictConfig
example on https://pyzmq.readthedocs.io/en/latest/api/zmq.log.handlers.html#module-zmq.log.handlers, for people like me who don't RTFM 😊
I'm happy to make PR by the way, just let me know!
Docs PR with a dictconfig example sounds great! I don't feel bad closing a PR, it's no big deal.
What pyzmq version?
24.0.1
What libzmq version?
4.3.4
Python version (and how it was installed)
3.10.9 via pyenv
OS
ubuntu 20.04
What happened?
I use
dictConfig
to configure my other loggers, but I needed a workaround (see below) to make it work withPUBHandler
.This happens because the
PUBHandler
constructor takessocket
as an arg, but withdictConfig
:Code to reproduce bug
Traceback, if applicable
More info
Workaround is to create:
Then use: