Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send Crashlytics log

I am using Crashlytics (now known as Fabric) in my app.

It works well when the app crashes. I can find the issue on the dashboard.

I am trying to use the logging. Something like:

Crashlytics.log(Log.WARN,MYTAG,"Error message");

I am not able to send this log in the dashboard. I have just tried to add something like:

Crashlytics.logException(new RuntimeException("Fake exception"));

but it doesn't send the log.

Can Crashlytics send the log?

like image 205
Gabriele Mariotti Avatar asked Apr 17 '15 07:04

Gabriele Mariotti


People also ask

How do I get Crashlytics log?

Crashlytics associates the logs with your crash data and displays them in the Crashlytics page of the Firebase console, under the Logs tab.

How does Crashlytics work?

Crashlytics saves you troubleshooting time by intelligently grouping crashes and highlighting the circumstances that lead up to them. Find out if a particular crash is impacting a lot of users. Get alerts when an issue suddenly increases in severity. Figure out which lines of code are causing crashes.


3 Answers

You are sending the Log properly. But see what Official doc says Logging Caught Exceptions

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

To reduce your users' network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches. If you don't see logged exceptions in your Crashlytics web dashboard, try restarting your app!

like image 147
Bharatesh Avatar answered Oct 12 '22 04:10

Bharatesh


In Android, send a custom crash by using

Crashlytics.logException(new RuntimeException("Fake exception"));

Then restart your application

In Crashlytics, select the Non-Fatals

enter image description here

like image 23
Linh Avatar answered Oct 12 '22 05:10

Linh


On newer versions of Crashlytics, you need to use these functions:

FirebaseCrashlytics.getInstance().log("Your message goes here")
FirebaseCrashlytics.getInstance().recordException(RuntimeException("Your message goes here"))

Edit:
As @Peter mentioned in the comments, using log alone will not work and you have to use recordException function to bundle your log message along with the exception

like image 2
Saman Sattari Avatar answered Oct 12 '22 03:10

Saman Sattari