What I am going to described has been tested with a 2.3 and a 4.4.2 devices, having exactly the same behaviour, so I isolated any potential issue coming from the change in access rights to LogCat.
I am using ACRA version 0.4.5
What I would like to do is very simple, make sure that I can send to the ACRA report at Cloudant the Logcat of the device filtered by my application name.
In order to perform this I followed the manual and some previous posts in SO (like this one: How to filter logcat output in ACRA?)
Ideally I should include in the configuration the following input:
logcatArguments = { "-t", "100", "MyApp:D", "*:S" }
However, this is not working properly and no error report arrives to the database, only 2 lines appear with an empty report. In order to ensure that there are logs I forced a LogCat output just before the forced calling, something like this:
Log.i(TAG + ":Sending Error or Suggestion", "My message ");
ACRA.getErrorReporter().handleException(null);
If I change (both devices) any of the following lines at the ACRA configuration:
logcatArguments = { "-t", "100", "MyApp:D"}
logcatArguments = { "-t", "100"}
I am getting the full report from LogCat without any filtering. I also tried including the -v long option (just in case).
Reviewing all answers in SO about this topic I found all of them outdated as I have not been able to explicitly find one related to this problem and the version 0.4.5.
Any idea what's happening?
======
After some investigation the problem is not so simple.
Currently all documentation available provides example of how to filter in ACRA using TAGs and at the moment is not clear how to filter by Application as in Eclipse.
So if you are experiencing the same error as me probably will be due because (as the answer provided to this question suggests) you are not using exactly the same TAGs in all your Logs.
ACRA just provides those arguments directly to logcat. So you question is really, how do I filter logcat.
The logcat filters are everything after the params.
Filter are of the form <tag>:<log_level>
.
If you specify a log_level of S
then you are marking those messages as silent, ie don't show them.
So in the config in which you are getting no messages:
logcatArguments = { "-t", "100", "MyApp:D", "*:S" }
You are asking for all message logged with tag MyApp
and to ignore all other messages. Since you are getting no log I would suggest that you have not actually used MyApp
as a log tag within your app.