7

I'm trying to set up my app with firebase+crashlytics for having a better error dashboard.

All the firebase stuff is already working and I'm able to access the features

I tested crashlytics with: Crashlytics.getInstance().crash(); // Force a crash
and i'm able to see the stack trace on my dashboard (inside firebase)

but I'm trying to log non-fatal messages like:
Crashlytics.log("test");

And it doesn't appear anywhere I followed the whole instructions at:
https://firebase.google.com/docs/crashlytics/customize-crash-reports

Still doesn't find any dashboard with the "test" messages

Where does it go? what am I missing?

Saeed
  • 2,169
  • 2
  • 13
  • 29
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
  • 1
    Related https://stackoverflow.com/questions/22430304/android-logging-using-crashlytics – AskNilesh Sep 10 '18 at 06:35
  • 1
    Hi, Paul from Crashlytics here. The Crashlytics.log("...") statements, if properly configured, should appear in your Firebase Crashlytics dashboard. If you're not seeing them, it may be a configuration issues, or, you should contact Firebase Support to better understand what's going on. – buser Sep 11 '18 at 19:32
  • 1
    @buser, after the previous comment I understood... Here is a suggestion for next Crashlytics releases: 99% of developpers doesn't read whole documentation of API before use it (as me), we read the necessary for basic configuration and then as we find problems we read more... It is not intuitive that a function called `log()` just append the logged information to the dashboard after the system crashes... You should let this information more explicit either in the function call or the api doc in a big block... everyday tons of people come here to ask the same thing – Rafael Lima Sep 12 '18 at 03:22

4 Answers4

6

Sending non-debug errors (e.g. your test message) logs to Crashlytics locally, but these exceptions are not uploaded until the app restarts.

As the documentation states:

Crashlytics batches logged exceptions together and sends them the next time the app launches.

This is presumably due to the primary Crashlytics functionality (reporting crashes) working in the same way, and non-fatal errors being a secondary concern using the same code flow.

Whilst this is unfortunate, there are many third party log-collating services that can handle the non-fatal errors.

Note: I'm aware you've received an answer in the comments from Crashlytics, I'm providing a more comprehensive answer for future visitors.

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
5

It's an old question any way i wanted to share what happens to messages logged using Crashlytics.log(msg); These logs are not immediately shown to dashboard. Crashlytics stores all the logged messages logged using log(msg) method and uploads it to server when a new Crash or Exception occurs.

You can see these messages in Firebase console under logs section as shown in below image

Firebase Crashlytics Dashboard

One more thing if you want to log exceptions there is another method for it Crashlytics.logException(exception)

Bali
  • 749
  • 6
  • 19
  • For logging exceptions, it's now `FirebaseCrashlytics.getInstance().recordException(e)` as mentioned in the documentation https://firebase.google.com/docs/crashlytics/customize-crash-reports?authuser=0&platform=android#kotlin+ktx_2 – flamyoad Jul 17 '21 at 02:07
0

Crashlytics isn't made for develop logging/debug, it is made to cluster hundreds/thousands of logs from different users at runtime, this may cause delays between the time the log message are recorded and when you will really be able to see them at the dashboard making it unusable for development debug.

If you want to use Crashlytics to follow the code workflow and debug during development, you will need to use the trick in this answer.

https://stackoverflow.com/a/69340289/5679560

Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
-1

As mentioned in below link https://support.crashlytics.com/knowledgebase/articles/120066-how-do-i-use-logging

You can see this crashes on Crashlytics dashboard if you look at the specific crash itself. The recommended way to add custom logging to your app is:

Crashlytics.log(int priority, String tag, String msg)

akaMahesh
  • 383
  • 2
  • 9