Get logs from android when app is app store
Asked Answered
D

7

5

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.

Dufresne answered 9/4, 2014 at 5:16 Comment(11)
I think Google-Analytics is what you are looking for.Lectern
Can we get the logs of same category using this ? Let's say I want to have all the logs where we use Log.e. Can We get this using Google-Analytics.Dufresne
That url is not working, giving 404, page not found errorLectern
I could found this thing in documentation developers.google.com/analytics/devguides/collection/android/v4/… Last section is logger section. I have tried to implement it this way. But it didn't work. So anyone having idea of how to do this?Dufresne
I don't see why it wasn't working.It wasn't even working for me. So I removed comment and added again. Please check again.Dufresne
Thats ok, here is another tutorial link, try it out myandroidtuts.blogspot.in/2013/04/…Lectern
But This only shows how to track event. My main concern is I want to get the logs. It could be any of these "ERROR", "VERBOSE", "INFO", "warn". Whatever I am getting , I will log accordingly.Dufresne
Then you need to write those logs into file and later on manually you can ask for those log files. This is a bad idea however.Lectern
I thought we will have something like that for android as we have testFlight for iOS.Dufresne
Hmm, I have no idea what is testFlight.Lectern
It allows you to log same category of logs. you can see this logs on their website even after we release our app.Dufresne
R
3

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.

Reiners answered 21/4, 2014 at 12:34 Comment(0)
T
1

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

Topside answered 9/4, 2014 at 5:39 Comment(1)
Crashes I am getting on Flurry. So it ok if don't get crashes. I want to logs it could be DEBUG, VERBOSE, INFO or ERROR. Do you know which does any of these, Because I don't want to store all these infos on our server.Dufresne
E
1

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.

Electrocute answered 20/4, 2014 at 18:39 Comment(2)
For Crashing We are using Flurry. I needed something with specific logs. Ex. Log.e, Log.d if its possible. Do Crashlytics has any feature that flurry is not having currently ?Dufresne
@Dufresne yes,custom log is possible with Crashlytics. refer this links for more information: support.crashlytics.com/knowledgebase/articles/… support.crashlytics.com/knowledgebase/articles/…Electrocute
E
1

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!

Elviraelvis answered 21/4, 2014 at 8:36 Comment(0)
E
1

Keeping in mind few things u can do it :-

  1. create log files.
  2. 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 )
  3. keep a service running at the background.
  4. 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.
  5. if uploads successfully delete dat file else leave it which will be uploaded next time.
  6. 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

Ewe answered 21/4, 2014 at 21:51 Comment(0)
C
0

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.

Condyloma answered 9/4, 2014 at 5:33 Comment(4)
where will I be able to see logs If I use this in my andorid app ?Dufresne
I will create a log files in location that will provide in phone memory or sd card. Then you can implement a service that will upload all the daily generated log files to your server or any cloud storage in background. Service can be run everyday at particular time or weekly or monthly whatever you like.Condyloma
But do you know any tool where i don't have to implement upload service myself ?Dufresne
Every user and every application has different requirements of logs those generated from log4j so I dont think so there will be any tool to upload them but yes then you can manually ask user to mail those logs by popping a alert to send logs and make zip and create email chooser.Condyloma
I
0

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.

Inesita answered 16/4, 2014 at 11:58 Comment(2)
Is that allowing you to get all the logs wherever u have used Log.(e,i,d).Dufresne
@Dufresne ACRA official page says that you can: Add custom variable states or traces; Add logcat, eventlog or radiolog extracts; Add DropBoxManager events; Add Device unique ID; Choosing which fields to be included in reports. I guess that there is no limits on LogCat ;-) .Inesita

© 2022 - 2024 — McMap. All rights reserved.