I am looking at how to log all Kafka topics/events. Is there any env variable that I can run my Kafka container? Just for the development purpose, I used
docker run -p 9092:9092 -e ADVERTISED_HOST=127.0.0.1 johnnypark/kafka-zookeeper
and when I run my python script I was able to consume and publish events
from kafka import KafkaConsumer
consumer = KafkaConsumer('other-topic')
for msg in consumer:
print (msg)
from kafka import KafkaProducer
producer = KafkaProducer()
producer.send('other-topic', b'some_message_bytes')
producer.flush()
I bet there is a way to log all events, but I could not find it.
PS. I want to log all events only for development purposes. I do not want to add handlers to watch all topics, but if there is a way to consume all topics by KafkaConsumer class then will be great to know about it too.