I need to get logs which is stored as a log file in end user device, for getting that I can implement send feedback option and make user send the file to a email address given in intent.
But I need something better than this like google analytics or some other logging stuff which is easy to use where we can upload a file, and still manage other log events too.
You can use Firebase, it's have many feature to use.
Report Crashes on Android
Firebase Crash Reporting creates detailed reports of the errors in your app. Errors are grouped into issues based on having similar stack traces, and triaged by the severity of impact on your users. In addition to receiving automatic reports, you can log custom events to help capture the steps leading up to a crash.
You can watch docs in here: https://firebase.google.com/docs/crash/android
Related
I'm looking to improve and get better insights into the apps behaviour right before a crash. In the production we have a lot of Timber.d and Log.XX calls issued but it is not possible to currently see the full application's log-stack in Firebase Crashlytics section. We only see the stacktrace of the crash as well as all the custom Firebase events that have been called.
Can someone advise on any feasible methods of forcing the application to submit the full log-stack upon a crash such that it would also be visible in Firebase?
There is no way to post full log files to Crashlytics.
What you can do:
Log events with Analytics at key points in your app's flow, which will then also show up (as a sort of breadcrumb) in your Crashlytics views by adding custom keys.
Write custom log messages for key points in your code leading up to the crash.
Set a user ID for your app instance, and then write the log file to another cloud based storage location (like Cloud Storage, for which there's also a Firebase SDK) with that same user id, after the app is restarted.
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?
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.
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
One more thing if you want to log exceptions there is another method for it Crashlytics.logException(exception)
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
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)
I'm developing an Android app that is currently in the Play Store. I've been getting reports of a crash on certain devices that I can't reproduce, and the Play Store's built in crash diagnostics don't contain enough information. What I really need is the Logcat information from these devices, but it seems that Android 4.1 and above don't allow the use of those "Log Collector" apps that used to be so popular for this purpose due to security concerns. Is there a library that I can add to my app that will allow it to log to a remote server on demand? I know enough about this crash that I could put a call to some mythical sendLogcatNow() function in the appropriate spot in the code, if I had such a function. Since the information I seek is not actually part of the crash (the crash occurs later), normal crash reporting tools such as Crashlytics don't seem like they will do what I need, but perhaps they have this feature and it's just not prominent in the documentation. Thanks!
There are few version for crash reporting..
Hockey App
Acra
BugSense
Android Remote stack trace
Since your app can always read logs for it's own process, you can also implement something of your own.
Out of all these, I personally prefer Acra. as it is most efficient and give many options to app developers.
I'm using ACRA for logging crashes from my app but based on their documentation,
you can add your own variables content or debug traces to the reports
you can send error reports even if the application doesn't crash
Which seems to be doing what you want.
https://github.com/ACRA/acra
You will need to run your own ACRA server (simple enough to run) and get your app to send the crash logs to your server. Everything is detailed on their website.
I would look into using a third party production crash system, there are a few out there. I am currently using Crashlytics. This specific service allows you to log and set key value pairs during the running of the application that get packaged with the crash report. These services also offer greater insight into the device type, OS and a variety of other device details.
With this set up I have then created a log function that will submit to the Crashlytics service as well as logging it to log cat.
You can also use Google Analytics or Flurry. But note that Google Analytics doesn't log stack traces and Flurry doesn't support real-time log reports on server.
I found a section Crash & ANR in my Google play account
This list the crashes occurred but this is when user report the crash.
I have well managed application but some times it is being crashed as reported by one user.
What i want to get a log from device for the application crashes and save and send automatically.
Is there any Process to get the details of all or Previous Crash from android systems on Next Application Start up?
You can trap and log it manually, but this is usually solved by integrating crash handling and reporting services like TestFlight, New Relic, and other similar services. There are some self-hosted, open source tools like android-remote-stacktrace too.
The libraries are set to capture any unhandled exception your application, log the exception to a remote server so you can view it without requiring the user to send it to you manually, and will then allow the original exception to be rethrown as normal.
Android Handling the Unexpected also covers the idea in detail with some sample code if you really want to do it yourself. That post also lists several more example external services.
Any ideas how can I create a bug report in my application and when application crash to open a dialog and give the user a chance to send us report with files attached to the e-mail and etc. I've already implemented a function which is sending the error message to out server, but I want to be able to let the user to send these errors with some text input, attached files and etc.
Any ideas how should I proceed?
You can find exactly what you're looking for in Instabug. It is a bug & crash reporting SDK that allows for two things:
Allows users to report bugs through a shake gesture in-app
Upon a shake, a screenshot is taken that the user can draw on for visual bug identification.
User can further describe the bug using text, extra screenshots, voice notes, or even screen recordings.
Automatically receive crash reports in the event of a crash
All reports arrive to your Instabug dashboard containing various details such as:
Network and console logs
Complete Device details
Visual reproduction steps
Crash stack trace (In case of a crash report)
It only takes a line of code to integrate.
For full disclosure, I work at Instabug. Let me know if I can help.
See ACRA. It's a solid crash reporting library.
You can get more information than the reports in Google Play, and there are a lot of configuration options detailing just which info you want and how you want it delivered. Default is to upload spreadsheets into Google docs.
Also allows user input at crash time.