2

There are servers running in multiple locations,I need to stream the application log data from these servers to a ZMQ(Zero Message Queue) using python stream handler.How do i use the stream handler to get this done? I have already referred the Python Handlers documentation https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler

CBU
  • 366
  • 3
  • 11

1 Answers1

1

You can post your logs from different servers as json to the ZMQ iteratively. For the ZMQ make a PyZMQ application which will have a message handler, listening to your incoming json from these servers. Then as per requirement the incoming json data can be processed and stored in a file (or wherever you want to store). This file can be read for the incoming logs ( eg: tail -f fileName.txt or fileName.log)

Here is link which will help you setup a PyZMQ application:

Designing and Testing PyZMQ Applications – Part 1

For logging specifically you can use these example:

A simple Python logging example

Logging, StreamHandler and standard streams

Community
  • 1
  • 1
Abhijay Ghildyal
  • 4,044
  • 6
  • 33
  • 54