Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Centralized logging using pyzmq

I am trying to implement a centralized logging server for my distributed app using pyzmq's built-in log handlers (see here). Although from an architectural standpoint I can understand the use of the PUB/SUB pattern, I cannot grasp the correct technical implementation of such a system.

Based on what I understand until now, since I would have N separate processes that would publish on N separate ports, I would really need N separate loggers in order to capture all the messages.

So this would mean that I need to open a separate "listener" process for every new publisher that I have on the system?

EDIT: To clarify the question: in the context of the tools provided with pyzmq, how do you implement a centralized logging server?

like image 489
lesingerouge Avatar asked Sep 17 '26 20:09

lesingerouge


1 Answers

Solved it using a suggestion found here:

One interesting aspect of the zmq.SUB sockets is that they can connect to multiple endpoints, so that they receive messages from all the publishers.

The solution is to use one listener that "subscribes" to all the available publishers.

like image 169
lesingerouge Avatar answered Sep 20 '26 13:09

lesingerouge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!