8

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());
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Otziii
  • 2,304
  • 1
  • 25
  • 34
  • `Crashlytics.logException(exception)` should do it. Usually there is a limit to number of non fatals that it records. Is none of them showing? `For any individual app session, only the most recent 8 logged exceptions are stored.` https://docs.fabric.io/android/crashlytics/caught-exceptions.html – Shobhit Puri Oct 02 '17 at 08:20
  • None are logged. Absolutely none. Not one. We have 70k daily users, so its definitively not working. – Otziii Oct 02 '17 at 08:35
  • I see. And as you've shown in the question, you've tried forcing a non-fatal crash. And I assume your filter is of last 90 days? Which version of the SDK are you using? – Shobhit Puri Oct 02 '17 at 08:37
  • Forced crash: Yes Filter: Yes SDK version: classpath 'io.fabric.tools:gradle:1.22.1' – Otziii Oct 02 '17 at 08:50
  • I have set to 1.23.0 and it works fine. Try updating it and maybe make sure you have `ext.enableCrashlytics = true`. Or atleast not set to false in `build.gradle`. Else open a bug report to them probably. – Shobhit Puri Oct 02 '17 at 09:05
  • Thanks for the help. Will try the changes you prepose. :) – Otziii Oct 02 '17 at 09:52
  • BTW: How do you instantiate Crashlytics in your app? – Otziii Oct 02 '17 at 09:55
  • Mike from Fabric here. Can you share your app's package name? – Mike Bonnell Oct 02 '17 at 13:09
  • Hey Mike! Its 'com.norwegian.travelassistant', could you contact me on mail: travelassistantATnorwegian.com ? – Otziii Oct 02 '17 at 14:21
  • @MikeBonnell Did you check it? – Otziii Oct 12 '17 at 13:01
  • 1
    Sorry, I missed your ping back! I'll follow up over email. – Mike Bonnell Oct 12 '17 at 15:36
  • I dont know why, but it suddenly worked. Thanks to @MikeBonnell for reaching out to help. :) – Otziii Nov 06 '17 at 12:55
  • @Otziii can you please share how you are able to see the logs in your Crashlytics dashboard ? – Neha Nov 15 '18 at 07:03
  • @Neha I did not do anything specific, it just worked after some time. – Otziii Nov 16 '18 at 09:10

2 Answers2

5

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.

John Connor
  • 109
  • 2
2

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

}
Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52