Hello,
Has anyone here ever tried to send Kafka and ZooKeeper logs to Sentry?
Since Apache Kafka and ZooKeeper are important services, I would like to redirect their error messages to Sentry. However, I’m not sure how to configure log4j to do so.
First I configured the log4j.properties file, which Kafka uses to learn its logging policy, with the following settings:
log4j.rootLogger=INFO, stdout, SentryAppender
log4j.appender.SentryAppender=com.getsentry.raven.log4j.SentryAppender
log4j.appender.SentryAppender.dsn=https://a6c1ffcb34e8442e8f9e2d62680d0910:3dcbddac54df410aa7c74f4772715f2d@sentry.io/130726
log4j.appender.SentryAppender.tags=dc:1,service:kafka
log4j.appender.SentryAppender.ravenFactory=com.getsentry.raven.DefaultRavenFactory
log4j.appender.SentryAppender.Threshold=WARN
However, Kafka’s output shows it couldn’t instantiate the Raven class queried by the Sentry Appender:
log4j:ERROR Could not instantiate class [com.getsentry.raven.log4j.SentryAppender].
java.lang.ClassNotFoundException: com.getsentry.raven.log4j.SentryAppender
According to the log4j module (https://docs.sentry.io/clients/java/modules/log4j/) Raven can be installed using Maven. However, since I haven’t compiled Kafka by myself, there is no pom.xml I can use to place this dependency.
How should I proceed?
Thanks in advance.
Gabriel.