I try to sends my spark application driver/executor logs to kafka topic. It is working in Eclipse.
While deploying cluster mode it is showing
ClassNotFoundException.
I added spark core
, spark-sql
, spark stream kafka
, spark streaming
, kafka streaming
and kafka-log4j-appender
maven's but still it is showing
org.apche.kafka.log4jappender ClassNotFoundException.
In server there is no kafka related jars available in my spark program running jar have itself.
Please anyone tell why it is not sending logs to kafka topic from spark driver/executor in cluster mode.
i tried the below link mentioned steps also,
spark streaming application and kafka log4j appender issue
og4j.rootLogger=INFO, console, KAFKA, file
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
log4j.appender.KAFKA=org.apache.kafka.log4jappender.KafkaLog4jAppender
log4j.appender.KAFKA.topic=test2
log4j.appender.KAFKA.name=localhost
log4j.appender.KAFKA.host=localhost
log4j.appender.KAFKA.port=9092
log4j.appender.KAFKA.brokerList=localhost:9092
log4j.appender.KAFKA.compressionType=none
log4j.appender.KAFKA.requiredNumAcks=0
log4j.appender.KAFKA.syncSend=true
log4j.appender.KAFKA.layout=org.apache.log4j.PatternLayout
log4j.appender.KAFKA.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L %% - %m%n
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=log4j-application.log
log4j.appender.file.MaxFileSize=5MB``
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-M` `M-dd` ` HH:mm:ss} %-5p %c{1}:%L - %m%n` `
How to send spark driver/executor logs to kafka topic via kafka-log4j-appender-2.3.0 using log4j.properties.