I've integrated Firebase Crashlytics
into my app as per Googles instructions:
https://firebase.google.com/docs/crashlytics/get-started
My problem is when I try to do custom logging such as:
Crashlytics.log("testing");
Crashlytics.log(Log.ERROR, TAG, "testing");
Crashlytics.getInstance().crash();
In Firebase Console
I get the crash stack callback (as expected) BUT only one (probably the first) log entry from the first Crashlytics.log
call done (not the ones above however).
I've waited 48h to see if there's a delay but nothing appears.
It works fine when I "force" the crash in the emulator.
I also tried new RuntimeException()
instead of Crashlytics.getInstance().crash()
I am calling the Crashlytics
functions in a library which is included in my app(s).
Mike from Firebase here. Crashlytics prioritizes capturing crashes over writing custom keys or logs as crashes are more important to capture. Once a crash happens, we need to act as quickly as possible to get the exact state of the device and all the threads running. Things are still changing and happening after a crash, so to get the most accurate stack trace, if a key or log has not been written out, we will drop that and capture the crash instead.
Given that the log you're not seeing is happening just before the crash occurs, I would expect the log closest to the crash to be ignored. When using custom logs and keys, it's best to log them as early as you can, for example when an activity changes. As a side note, for non-test crashes, this is usually not an issue since you don't know in advance where the crash will occur in your app.