logcat is missing in acra logs when switching to latest build

186 views
Skip to first unread message

ssp80

unread,
Jan 24, 2013, 7:10:40 PM1/24/13
to acra-d...@googlegroups.com
I've been successfully using ACRA for a while. I'm still using acra-4.2.3.jar I tried to simply update the jar file to the latest build (acra-4.4.0.jar) and it doesn't work that good anymore for my build, reports are much smaller and completely miss logcat output. Any reason I don't have logcat anymore?

here are the changes that I update in my code:

import org.acra.*;
import org.acra.annotation.*;
import android.os.Build;

...
@ReportsCrashes(formKey = "dEJyZG1abDExaDVic2hrLVVmTTg1Nmc6MQ", logcatArguments = { "-t", "2000", "-v", "time" })
...
ACRA.init(this);
ErrorReporter.getInstance().putCustomData("buildserver_id", "bld1359");
ErrorReporter.getInstance().putCustomData("sdk_version", Integer.toString(Build.VERSION.SDK_INT));
super.onCreate();


These changes I add to the manifest:
  <uses-permission android:name="android.permission.READ_LOGS"></uses-permission>


William Ferguson

unread,
Jan 24, 2013, 11:47:28 PM1/24/13
to acra-d...@googlegroups.com
I don't ever request logs so I'm guessing here.

Are logs only missing for some versions of Android?
The READ_LOGS permission is no longer required for JellyBean and up (IO 2012)

Perhaps ACRA is checking for that permission and apps on JellyBean devices don't report it, so no logs are appended. NB logs on JellyBean don't require READ_LOGS to read but only contain log records written by the App.

William

ssp80

unread,
Jan 25, 2013, 12:49:56 AM1/25/13
to acra-d...@googlegroups.com


On Thursday, January 24, 2013 11:47:28 PM UTC-5, William Ferguson wrote:
I don't ever request logs so I'm guessing here. 

For us logs are very important, on top of that we need to see logs from entire phone. Sometimes it's sd-card removal that f*ks it up, or some other system-wide action and the only way to guess is to look into logs that were generated around the time when the app crashed. On top of that, our app actually uses multiple processes and we need logs from them as well.

 
Are logs only missing for some versions of Android?
The READ_LOGS permission is no longer required for JellyBean and up (IO 2012)

Perhaps ACRA is checking for that permission and apps on JellyBean devices don't report it, so no logs are appended. NB logs on JellyBean don't require READ_LOGS to read but only contain log records written by the App.


I tried only one phone, not even sure what model it was, I stopped testing since results were unacceptable. In short, I used absolutely identical setup (fully described in the first message), except that I tried to install with acra 4.2.3 and 4.4.0 jars. Old acra produces perfect results and I have no complaints, I was just thinking to update in case if there are some new goodies, but contrary to my expectations it produced way less info (e.g. missing logcat).


William Ferguson

unread,
Jan 25, 2013, 1:00:48 AM1/25/13
to acra-d...@googlegroups.com

For us logs are very important, on top of that we need to see logs from entire phone. Sometimes it's sd-card removal that f*ks it up, or some other system-wide action and the only way to guess is to look into logs that were generated around the time when the app crashed. On top of that, our app actually uses multiple processes and we need logs from them as well.


Well, unless your users have root access you are bound for disappointment. From JellyBean onwards you cannot get access to the complete device logs. This is not ACRA specific.
 
I tried only one phone, not even sure what model it was, I stopped testing since results were unacceptable. In short, I used absolutely identical setup (fully described in the first message), except that I tried to install with acra 4.2.3 and 4.4.0 jars. Old acra produces perfect results and I have no complaints, I was just thinking to update in case if there are some new goodies, but contrary to my expectations it produced way less info (e.g. missing logcat).

Sorry NFI. Have a look at he ACRA code.

ssp80

unread,
Jan 25, 2013, 1:05:53 AM1/25/13
to acra-d...@googlegroups.com
Well, unless your users have root access you are bound for disappointment. From JellyBean onwards you cannot get access to the complete device logs. This is not ACRA specific.

I didn't know that. What if I have two processes and my device has that restriction, can I somehow get access to logcat from all my processes? I don't know java that much, I'll ask some of my buddies to check if it's possible to spot what's different between 4.4.0 and 4.2.3 that breaks that old behavior (that attaches logcat)
 

William Ferguson

unread,
Jan 25, 2013, 1:12:07 AM1/25/13
to acra-d...@googlegroups.com
I'm not 100% sure what you mean by "processes" here. If you have multiple processes executing within your app (which you can by specifying same in your Android Manifest) then you will be able to see the logs for all those processes.

But you will not be able to see the logs for ANY other apps running on the device.
This include logs for system level apps.

William

Kevin Gaudin

unread,
Jan 25, 2013, 1:53:53 AM1/25/13
to acra-d...@googlegroups.com

Hi, I modified the logcat collection code to comply with the new jellybean logs access policy and the old one... There might be a bug here, I'll have to test again. It would help if you could provide the android version that was running on your test device.

Kevin

William Ferguson

unread,
Jan 25, 2013, 4:43:34 AM1/25/13
to acra-d...@googlegroups.com
No, looks good to me. Change made in rev#f6bddb3 on 16-Aug-12. 4.4.0 was released on 23-Oct-12

As long as you have ACRA.PREF_ENABLE_SYSTEM_LOGS == true you are good. And this didn't change.

            if (prefs.getBoolean(ACRA.PREF_ENABLE_SYSTEM_LOGS, true)
            && (pm.hasPermission(Manifest.permission.READ_LOGS))
            || Compatibility.getAPILevel() >= 16) {



One of these should be coming out in the logs. Which one are you seeing ssp80?
  Log.i(ACRA.LOG_TAG, "READ_LOGS granted! ACRA can include LogCat and DropBox data.");
  Log.i(ACRA.LOG_TAG, "READ_LOGS not allowed. ACRA will not include LogCat and DropBox data.");

William
Reply all
Reply to author
Forward
0 new messages