Is there a way to attach complete logcats to crashes using Firebase Crash Reporting? I did notice that the Firebase SDK has some log functions, but those have to be specifically invoked. My app already does a ton of logging to logcat using our own custom loggger (not Android logger) anyways, so I would hate to have to duplicate the log calls to Firebase.
For example, I would need to do:
MyLogger.d(TAG, "my log message");
Firebase.log("my log message");
Sending a complete logcat isn't really possible because modern Android permissions don't allow apps to access that any more (as logs could easily and accidentally contain sensitive information). You will need to invoke the logging API to get logs attached. It's advisable to hook your existing logging infrastructure to make this happen without duplication at every location.
Related
In firestore references, a method is given as
public static void setLoggingEnabled (boolean loggingEnabled)
And in its description given
"Globally enables/disables Firestore logging for the SDK"
I don't understand what it means by global here, because I am already able to add failure listeners and add logs
Will it sends logs directly to firebase Crashlytics or
Logs will be saved on all devices which uses my app or
Will it be only visible in my android studio logs?
Should I enable this? Please help me out.
Enabling this logging will write additional information to the logcat output of your app on things like wire traffic (so the data that goes over the wire), encoding an decoding of the data, and much more. This sort of information is typically used for troubleshooting problems in the implementation. No information is sent to Crashlytics, nor are these logs automatically saved anywhere.
I'm hoping to use the OpenLocate library to help post location data in my application. I've been trying to test that it is working before I start posting events over HTTP calls sent somewhere.
I want to verify two main things
Events are being collected at the frequency I expect
Events are being stored in the database
I've verified that OpenLocate is tracking when I run the app by printing out the OpenLocate.getInstance().isTracking() flag. I've also tried using Stetho to inspect my package to see if I could read the db, but unfortunately nothing shows up.
If anyone has some experience with OpenLocate and can give me some info that would be great.
I've implemented an ErrorHandler class into my app which is working just great but as I'm not sure if what I'm doing can fit into "best practices" just would like to share it with you to have your opinion.
My question is silly and my class is very simple. All that I do is the next: in every catch block of my whole java code I do a call to ErrorHabdler.log(e) (which works as an AsyncTask) and as I'm working with AWS what log(e) does is capture all information about the error, like message, device name and model, etc (NO user information) and sends a formatted email with the error to a specific email address.
Another possibility would be to create a new table into my AWS DynamoDB set called Exceptions and instead of sending an email in background write the error log into that new table to have errors more "centralized".
I'd like to know if you consider what I'm actualli doing a good practice, or if you prefer my second choice, or maybe none of them and you would better use a third party error logger.
Best!
There are several Crashlytics tools on the internet.
The best choice is to go to these tools, which make it easier to control crashes reports.
The most common, and is what I use in most of my projects, is Frabric.IO Crashlytics ,: https://fabric.io/kits/android/crashlytics
You can follow these steps to install Crashlytics in your project: https://fabric.io/kits/android/crashlytics/install
Currently we can use logcat or ask other testers to send logcat files. But What i want as to see logs when app is on play store. So let's say if any request contact us for some problem that he is facing. Then it would be easier for us to see that user's device logs and figure out the issue. Because some issues are not easily reproducible.
Is there a way I can get the logs of device which i don't have a physically access to using some tool when the app is on play store?
EDIT
I don't want use in a way where user has to upload logs files and manually send it to our team. It should display live log on a website or provider's console.
You can track logs with Google Analytics. Just send trackers to analytics on the places you usually send logs.(You must initialize tracker first. See link below)
Example :
Tracker defaultTracker = GoogleAnalytics.getInstance(this).getDefaultTracker();
defaultTracker.send(MapBuilder.createEvent("Logger", "Log_Tag",
"Log_msg", null).build());
And you will get a event group in the Behaviour section of google analytics called Logger that has list of Log_Tags that has List of Log_msg
It is pretty easy to implement. See this link on how to add Google Analytics to your app https://developers.google.com/analytics/devguides/collection/android/v3/
Hope this helps you.
You need a custom Log service to store the important logs/errors
From your app if any crashes or important Logs you send it Log server for future reference.
Click Here
You should try Crashlytics
Crashlytics for Android delivers real-time crash reporting across all devices. We perform a deep analysis of each stack trace to identify the most important frames and we break down every bug by device model and version so you can spend less time finding and more time fixing issues.
What if "NETWORK" is not available when your app crashed on users device to update/send a crash report to you.
For me,
1.) I will get Crash Reports when User hits "Report to developer" at the time of crash.
2.) I use Google Analytics, to get the description of the app with location(which line of code) of error from "Crashes and Exceptions" under "Behaviour" tab.
Also, by modifying/adding your Google Analytics Code, as mentioned here: Crashes & Exceptions
Try your Luck!
You can use Log4j library in android.
What is Log4j library?
It is an logger library in java. And it allow the application to write logs in to your file, email when caught exceptions and can send logs in background to your server or any else. So that you can see the logs of every individual device and track the issues.
download it from the below link:
Log4j for android
Hope it will help you.
Currently I'm using ACRA.
The official link contains all details you need and offers different way of "User interaction mode", "Reports destination" and "Reports content".
If you implement it very well on your app, you can have a full report of what is happening.
Keeping in mind few things u can do it :-
create log files.
store them in your applications private area and not in sdcard ( to avoid deletion by user
or if on sdcard then use . before directory to hide it from user )
keep a service running at the background.
start uploading the document after every hour or when app moves in the background or the
file size increase >10 kb etc... depends upon choice. and remember to upload all files
in this directory.
if uploads successfully delete dat file else leave it which will be uploaded next time.
try to implement zip to make single file if file count is gr8er then 5 suppose.
In a nutshell :-
a. record.
b. zip
c. upload
c. delete.
this is my view remember
I am using ACRA as a crash and error reporting lib in my Android app.
It offers an option to send the content of LogCat along with the error reports, but I do not wish to use this feature as it requires a READ_LOGS permission, that may represent a threat to some users.
I am essentially interested in sending my own application debug logs along with the error reports I send using ACRA. Of course there needs to be a maximum size of this debug history (e.g. only the last 20 messages would be saved and sent). And I could store messages by simply calling something like storeLog("User has clicked button 1").
To achieve this, I would need either:
a circular buffer, storing (Timestamp t, String message) pairs. Drawback of this option: need to pass this buffer between classes, loss of history on application exit (unless if I save it to a file or SharedPreferences)
a rolling file.
Which option is to be preferred, and how can it be implemented (especially the "rolling" behavior) ?