Search code examples
javaandroidlog4jsentryraven

Logging to Sentry in Android with extra info


I have logging working to Sentry from android just using the EventBuilder from raven-java, but I need to attach extra info which apparently EventBuilder or java.util.logging can't do. I tried to use log4j but it doesn't pick up log4j.properties, how can I configure it with the Sentry DSN and other information? I have no preference about what logging library to use, so logback or log4j2 will do but they seem to suffer from the same problems.

I tried to configure logging programmatically but can't add the appender SentryAppender.

I also tried using android-logging-log4j library but this has the same problem.

I realize that https://github.com/joshdholtz/Sentry-Android exists which might work but it doesn't do retries in case of network issues which is quite important.


Solution

  • The https://github.com/joshdholtz/Sentry-Android library now supports saving of offline captures and failed captures as of version v1.1.0 - https://github.com/joshdholtz/Sentry-Android/releases/tag/v1.1.0