I am using Crashlytics and fatal crashes get delivered. However the data added with
Crashlytics.log(mytext);
is not showing anywhere in Fabric Dashboard.
I couldnt find any hint on a necessary setup or configuration in the docs. What am I missing?
I was able to get the logs using the following way.
I added an "UPLOAD LOGS" button on my application's settings page so when the user clicks on it the following will happen.
Crashlytics.logException(new Exception("Upload Log exception"));
Intent mStartActivity = new Intent(thisActivity, SettingsActivity.class);
int mPendingIntentId = 123456;
PendingIntent mPendingIntent = PendingIntent.getActivity(thisActivity,mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager mgr = (AlarmManager)thisActivity.getSystemService(Context.ALARM_SERVICE);
mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 200, mPendingIntent);
System.exit(0);
The above code would invoke a non fatal exception which will upload all the logs of the current session to crashlytics and then restart the app after 200ms which is a requirement for crashlytic to upload the logs to remote (Because invoking non fatal error does not restart the app like a fatal crash does)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With