Use the pipe operator when you are running the console consumer. It will log all the messages which are getting consumed, to a file.
kafka-console-producer.sh --broker-list localhost:9092 --topic Topic < abc.txt
Hope this helps!
To know more about Kafka, I would recommend you to enroll with Kafka training online today.