I have kafka consumer and output which is live stream of data should be captured on hourly basis in a log file. Took help from this link [1]: https://richard-purves.com/2017/11/08/log-rotation-mac-admin-cheats-guide/
Created a log file kafka.log in /var/log and config file for the same named kafka.conf in /etc/newsyslog.conf
Tried running kafka consumer that creates log file under /var/log/kafka.log
python3 consumer.py --kafka-broker "xxx" --kafka-topic "yyy" --kafka-group-id cxel-yellow-vsg-qoe --kafka-ssl-keyfile "key" --kafka-ssl-certfile "certificate --kafka-ssl-cafile /usr/local/etc/openssl@1.1/cert.pem --schemas prod --kafka-security-protocol SSL >> sudo /var/log/kafka.log 2>&1 &