android - Trouble with logging my data with crashlytics -
i'm trying logs service info crashlytics in android application. don't see logs in dashboard. used this:
string mylog = getservicedata(); //mylog not null , non-empty crashlytics.log(mylog);
and this:
string mylog = getservicedata(); //mylog not null , non-empty crashlytics.log(log.error, getstring(r.string.app_name), mylog);
i tried generate exception in application , handle it, have no results:
try { int = 0; = 1/a; } grab (exception e) { crashlytics.log(mylog); }
also read on crashlytics log not sent need initialize crashlytics before log data. set crashlytics.start(this) in onstart() event of activity didn't see logs in dashboard again. @ lastly tried set crashlitycs.start(this) straight before logging data, still have no logs in dashboard.
plase, tell me wrong , how custom logs in crashlytics dashboard?
i had similar situation. experimenting, able deduce rules crashlytics' behavior.
crashlytics upload crash study "to dashboard" if fatal exception occurs. in other words, when app crashes. , nil shows unless , until crash study uploaded.
if log non-fatal exception, using crashlytics.logexception(e)
, crash study not uploaded till next time app restarted. not see exception in crashlytics dashboard till app restart.
you can tell when upload occurs because you'll see sort of message in logcat:
07-17 19:30:41.477 18815-18906/com.foo.bar i/crashlytics﹕ crashlytics study upload complete: 55a9ba0c01d7-0001-462d-b8b4c49333333.cls
a crashlytics log message must associated fatal or non-fatal exception show in dashboard.
furthermore, log messages aren't associated exception do not survive app restart.
so, if log few messages, restart app, app throws exception, or logs non-fatal exception using crashlytics.logexception()
, log messages lost. not show in dashboard.
if want log messages without fatal exception, utilize 1 or more crashlytics.log()
statements followed crashlytics.logexception()
.
to verify works, have code run, restart app. in dashboard, should see logs associated issue created non-fatal exception. in wild, you'll have trust users restart app regularity.
android logging crashlytics