Separate log file for connector
The logs for Kafka connectors are generally added to connectDistributed.out. If you want to create a separate log file for your connector then you can update the following log4j.properties file.
../etc/kafka/connect-log4j.properties
Add the following lines to the file:
log4j.appender.connectorNameSpace=org.apache.log4j.RollingFileAppender
log4j.appender.connectorNameSpace.DatePattern=’.’yyyy-MM-dd-HH
log4j.appender.connectorNameSpace.MaxFileSize=10MB
log4j.appender.connectorNameSpace.MaxBackupIndex=10
log4j.appender.connectorNameSpace.File=${kafka.logs.dir}/connect-my.log
log4j.appender.connectorNameSpace.layout=org.apache.log4j.PatternLayout
log4j.appender.connectorNameSpace.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L – %m%n
log4j.logger.kafka.connect.connectorNameSpace=INFO, connectorNameSpace
log4j.additivity.connector.name.space=false