Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Crashlytics not logging non-fatals

I'm logging crashlytics errors in fabric. It works for crashes, and auto-generated non-fatals. But when I try to manually log non-fatals, it doesnt show at all. What can be the problem? (Yes, I have re-opened the app after the logging).

The logging methods I have tried:

Crashlytics.log(message);

Crashlytics.getInstance().core.logException(exception); //Caught exception

Crashlytics.logException(exception); //Caught exception

Crashlytics.logException(new Throwable(message));

None of them show up in my fabric dashboard...

I instantiate Fabric with this and its logging crashes, so I don't think that's the problem.

Fabric.with(this, new Crashlytics());
like image 384
Otziii Avatar asked Oct 02 '17 08:10

Otziii


2 Answers

In Crashlytics BETA in firebase console 'Crashes only' events displayed by default. If you want view non-fatal events you must select 'All events' or 'Non-fatals only'.

Maybe it can help in Fabric console.

P.S. I don't worked with fabric without firebase.

like image 100
John Connor Avatar answered Oct 16 '22 09:10

John Connor


Try this, it's working code from my projects.

try {
    //your codes                    
} catch (Exception ex) {
    ex.printStackTrace();
    Crashlytics.log("log something");//Optional
    Crashlytics.setString("message", message);//Optional
    Crashlytics.logException(ex);

}
like image 31
Oğuzhan Döngül Avatar answered Oct 16 '22 09:10

Oğuzhan Döngül