Sentry是一個(gè)實(shí)時(shí)事件日志記錄和匯集的平臺(tái)压汪。其專注于錯(cuò)誤監(jiān)控以及提取一切事后處理所需信息而不依賴于麻煩的用戶反饋娄猫。
集成:
//app-build.gradle:
implementation 'io.sentry:sentry-android:1.7.27'
初始化:
//MyApplication:
String sentryDsn = "http://6c89c12e4d4e4ee7a007ee5166637642@183.230.93.80:9100/8";
Sentry.init(sentryDsn, new AndroidSentryClientFactory(getApplicationContext()));
獲取Dsn:
//項(xiàng)目-設(shè)置
項(xiàng)目-設(shè)置
混淆:
-keepattributes LineNumberTable,SourceFile
-dontwarn org.slf4j.**
-dontwarn javax.**
官方文檔:
https://docs.sentry.io/clients/java/integrations/#android
官方demo: https://github.com/getsentry/examples/tree/master/android
PS:
1 其實(shí)很簡(jiǎn)單的集成,建議不要去看官方的集成文檔很坑,直接看demo都好!
2 另外就是異常信息如果是同類型的會(huì)歸為1個(gè)異常里面 需要點(diǎn)異常信息進(jìn)去查看 我之前就是一直以為沒有集成成功,最好才發(fā)現(xiàn)是篩選后遭成的顯示問題