Adding Sentry to AEM logging


We’re using Adobe Experience Manager (AEM) and I was wanting to add Sentry logging to the Java environment. For those not in the know AEM is a Java app which uses Sling and OSGi for loading dependencies.

I’ll prefix this by saying that I am not really a Java guy (though I can stumble my way through). I’m wanting to add Sentry alerts to any Java errors/exceptions that are happening.

In AEM you can alter the settings by modifying the config for but I am unsure what I should be setting. I’ve got the Sentry Java client as a dependency of the overall project.

I want to have all log files processed by Sentry.

Is there anyone who has wired up Sentry with AEM?

Reading the documentation it seems that you need to set up Sentry as an appender to the logger, and then set some Environment variables to configure it. I’m not sure where I should be configuring this though.

Is anyone able to advise on the correct/best way to do this?



I have a similar use case: an internal app is using OSGi and already uses logback-classic.

I was able to add the logstash-logback-encoder by simply renaming the jar file, but for raven-logback it won’t be enough.

Also, I wasn’t able to find a tutorial on making raven-logback OSGi-compatible :frowning: and all my current attempts are ending with:

ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type com.getsentry.raven.logback.SentryAppender java.lang.ClassNotFoundException: com.getsentry.raven.logback.SentryAppender cannot be found by ch.qos.logback.classic_1.2.2