hpgrahsl / kafka-connect-mongodb

**Unofficial / Community** Kafka Connect MongoDB Sink Connector -> integrated 2019 into the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log is not getting appended in File

sourjya123 opened this issue · comments

Hi
I am using the kafka mongo connector. When I am running the connector the log is coming on console. But I want to store that log also in a file while it is running on server. In the kafka-connect-mongodb project I have added file-appender in logback.xml file. After that also I am not able to store the log in file. Please let me know any configuration is required for that.

Hi Hans
I am facing the same issue.

hi @sourjya123 & @RAHULMJP
the logback.xml file in the project itself is not meant to change log level for running the connector on your connect server. so no matter what you put there it won't have any effect. the way you configure connect logging is based on a different log4j.properties files that comes with the installation / package you use. there is a nice blog post which also shows how to configure the logging into files.
https://rmoff.net/post/kafka-connect-change-log-level-and-write-log-to-file/

I think that should do it for what you need. Also in the newest Kafka release 2.4 you will be able to dynamically change the log level for any connector even during runtime via the REST API.

Let me know if you need anything else. Thx for reaching out!

hi @sourjya123 & @RAHULMJP
the logback.xml file in the project itself is not meant to change log level for running the connector on your connect server. so no matter what you put there it won't have any effect. the way you configure connect logging is based on a different log4j.properties files that comes with the installation / package you use. there is a nice blog post which also shows how to configure the logging into files.
https://rmoff.net/post/kafka-connect-change-log-level-and-write-log-to-file/

I think that should do it for what you need. Also in the newest Kafka release 2.4 you will be able to dynamically change the log level for any connector even during runtime via the REST API.

Let me know if you need anything else. Thx for reaching out!

Thanks it is working now.
My another question is if my kafka has 3 brokers and want to send to mongo using this connector. can this connector can handle multiple messages? Or do I need to create another and handle when more traffic comes.