Trouble with logging my data with crashlytics

后端 未结 4 1545
萌比男神i
萌比男神i 2020-12-14 00:51

I\'m trying to get logs with some service data with Crashlytics in my android application. But I don\'t see my logs in dashboard. I used this:

String myLog =         


        
4条回答
  •  半阙折子戏
    2020-12-14 01:56

    according to Crashlytics knowledgebase:

    Logged messages are associated with your crash data and are visible in the Crashlytics dashboard if you look at the specific crash itself.

    And from my experience this seems true. However I am unsure as to what determines which logging is associated with a crash report. Perhaps a time window (time around crash) or a limited number of logs (before the crash) is associated with the crash report?

    However Crashlytics knowledgebase does say that exceptions can be logged:

    All logged exceptions will appear as "non-fatal" issues in the Crashlytics dashboard.

    So if you changed your try/catch to:

    try {
       int a = 0;
       a = 1/a;
    }
    catch (Exception e) {
       CrashLytics.logException(e);
    }
    

    then it should show up in the Crashlytics dashboard.

提交回复
热议问题