Search code examples
androidexceptioncrash-reportscrashlyticsgoogle-fabric

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());

Solution

  • 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);
    
    }