Stephan
Stephan

Reputation: 363

Kafka Connect separated logging

Currently we are using a couple of custom connetor plugins for our confluent kafka connect distributed worker cluster. One thing that bothers me for a long time is that kafka connect writes all logs from all deployed connectors to one File/Stream. This makes debugging an absolute nightmare. Is there a way to let kafka connect log the connectors in different Files/Streams?

Via the connect-log4j.properties I am able to let a specific class log to a different File/Stream. But this means that with every additional connector I have to adjust the connect-log4j.properties

Thanks

Upvotes: 2

Views: 3062

Answers (2)

CSFreak
CSFreak

Reputation: 1

I added this connector.context to log4j.appender.connectAppender.File=${kafka.logs.dir}/connect.log but I was not able to get any connector log separately. Also, the name of the file is not formed with the connector name. It was formed with the variable name - "connector.context"

Upvotes: 0

Robin Moffatt
Robin Moffatt

Reputation: 32090

Kafka Connect does not currently support this. I agree that it is not ideal.

One option would be to split out your connectors and have a dedicated worker cluster for each, and thus separate log files.

Kafka Connect is part of Apache Kafka so you could raise a JIRA to discuss this further and maybe contribute it back via a PR?


Edit April 12, 2019: See https://cwiki.apache.org/confluence/display/KAFKA/KIP-449%3A+Add+connector+contexts+to+Connect+worker+logs

Upvotes: 4

Related Questions