Search code examples
androidcrashlyticstwitter-fabriccrashlytics-android

Android Fabric - send Caught Exceptions at custom interval


According to Fabric documentation Fabric doc to reduce user traffic, caught exceptions are sent only when the app launches -

Crashlytics processes exceptions on a dedicated background thread, so the performance impact to your app is minimal. To reduce your users’ network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches.

try {
  myMethodThatThrows();
} catch (Exception e) {
  Crashlytics.logException(e);
  // handle your exception here!
}

But for this particular app, the app will be always on, and is not intended to be relaunched. So the question is -

How to force the logs to be sent after some time, or on some event?


Solution

  • Mike from Fabric here.

    Currently our SDK doesn't offer a way to manually flush or push over the logs from a running Android app. Logged exceptions are sent on relaunch of the app.