Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crashlytics.log not showing in Fabric Dashboard

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?

like image 572
michaelsmith Avatar asked Jul 06 '17 05:07

michaelsmith


1 Answers

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)

like image 168
Ismail Iqbal Avatar answered Sep 30 '22 12:09

Ismail Iqbal