Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultReportSenders + CustomReportSender #286

Closed
ldima opened this issue Jun 25, 2015 · 13 comments
Closed

DefaultReportSenders + CustomReportSender #286

ldima opened this issue Jun 25, 2015 · 13 comments

Comments

@ldima
Copy link

ldima commented Jun 25, 2015

Hello. Can I use a standard mechanism for sending error + my custom. At the same time?
For example use the standart Reporter - (send to cloudant) and custom Reporter (write to a disk file) At the same time for One Error ?

I try write but work or Standart (cloudant) or Custom (write to a disk file)
ACRA.getErrorReporter().removeAllReportSenders();
if (inputValue) {
ACRA.getErrorReporter().setDefaultReportSenders();
ACRA.getErrorReporter().addReportSender(saveInLog);
} else {
ACRA.getErrorReporter().setReportSender(saveInLog);
}

I would like to help
thanks

@william-ferguson-au
Copy link
Member

As far as I can tell this should work.
ErrorReport.startSendingReports() passes all the Senders to the SendWorker which sends the report to all of them.

@ldima
Copy link
Author

ldima commented Jun 27, 2015

startSendingReports() private.

I can work or standard or custom.
Simultaneously, they both do not work
William please check whether at work simultaneously.

I can not find that I could not miss
i write ACRA.init(application);
and
ACRA.getErrorReporter().removeAllReportSenders();
if (inputValue) {
ACRA.getErrorReporter().setDefaultReportSenders();
ACRA.getErrorReporter().addReportSender(saveInLog);
} else {
ACRA.getErrorReporter().setReportSender(saveInLog);
}
but not work it!

@william-ferguson-au
Copy link
Member

So what does you log say?

@ldima
Copy link
Author

ldima commented Jun 29, 2015

1)LogCat filter - ACRA
2)Without Internet

One custom sender - write in log on disk

D/ACRA﹕ ACRA is enabled for by.mrsoft.mrdoc, intializing...
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
E/ACRA﹕ ACRA caught a NullPointerException for by.mrsoft.mrdoc
-stack trace
D/ACRA﹕ Building report
D/ACRA﹕ Using default Report Fields
I/ACRA﹕ READ_LOGS granted! ACRA can include LogCat and DropBox data.
D/ACRA﹕ Retrieving logcat output...
D/ACRA﹕ Writing crash report file 1435560763000.stacktrace.
D/ACRA﹕ About to start ReportSenderWorker from #handleException
D/ACRA﹕ Mark all pending reports as approved.
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
D/ACRA﹕ #checkAndSendReports - start
D/ACRA﹕ Waiting for 2000 millis from 1435560763643 currentMillis=1435560763762
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
I/ACRA﹕ Sending file 1435560763000-approved.stacktrace
D/ACRA﹕ Waiting for -- and Worker
D/ACRA﹕ #checkAndSendReports - finish
D/ACRA﹕ Finished waiting for Toast + Worker
D/ACRA﹕ Wait for Toast + worker ended. Kill Application ? true
E/ACRA﹕ by.mrsoft.mrdoc fatal error : null
-stack trace
I/ACRA﹕ Finishing the last Activity prior to killing the Process
I/ACRA﹕ Finished class by.mrsoft.mrdoc.MainActivity

Two sender (standart + custom)

D/ACRA﹕ ACRA is enabled for by.mrsoft.mrdoc, intializing...
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
E/ACRA﹕ ACRA caught a NullPointerException for by.mrsoft.mrdoc
-stack trace
D/ACRA﹕ Building report
D/ACRA﹕ Using default Report Fields
I/ACRA﹕ READ_LOGS granted! ACRA can include LogCat and DropBox data.
D/ACRA﹕ Retrieving logcat output...
D/ACRA﹕ Writing crash report file 1435561043000.stacktrace.
D/ACRA﹕ About to start ReportSenderWorker from #handleException
D/ACRA﹕ Mark all pending reports as approved.
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
D/ACRA﹕ #checkAndSendReports - start
D/ACRA﹕ Looking for error files in /data/data/by.mrsoft.mrdoc/files
I/ACRA﹕ Sending file 1435561043000-approved.stacktrace
D/ACRA﹕ Waiting for 2000 millis from 1435561043219 currentMillis=1435561043345
D/ACRA﹕ Waiting for -- and Worker
D/ACRA﹕ Connect to https://mrdoc.cloudant.com/a........................._update/report
D/ACRA﹕ Sending request to https://mrdoc.cloudant.com/a.....................4f6f-846f-1a8de17e7d88
E/ACRA﹕ Failed to send crash report for 1435561043000-approved.stacktrace
D/ACRA﹕ #checkAndSendReports - finish
D/ACRA﹕ Finished waiting for Toast + Worker
D/ACRA﹕ Wait for Toast + worker ended. Kill Application ? true
E/ACRA﹕ by.mrsoft.mrdoc fatal error : null
-stack trace
I/ACRA﹕ Finishing the last Activity prior to killing the Process
I/ACRA﹕ Finished class by.mrsoft.mrdoc.MainActivity

tnx for help William

@william-ferguson-au
Copy link
Member

Well if you are trying to send to https://mrdoc.cloudant.com/a........................._update/report and you don't have internet I would expect it to fail.

@ldima
Copy link
Author

ldima commented Jun 29, 2015

Acre does not custom Sender if there is no Internet.
I have 2 parcels, one for the Internet other offline file recording.
I need to be able to work 2 Sender independently. if there is no Internet to write to the file occurred. How can I do it?

How to change the order to do add first Sender (custom) and add two Sender standart?
How get standart Sendt how Object?

@william-ferguson-au
Copy link
Member

Hi @ldima ACRA is meant to attempt to send to all Senders and only fail if it couldn't send to at least one. But I can see an issue in SendWorker.sendCrashReport() that would cause ACRA to fail if the first Sender failed.

Could you please try the fix I have made in this branch https://github.com/ACRA/acra/tree/issue-286

@ldima
Copy link
Author

ldima commented Jul 11, 2015

Hello William.

tnx for help and branch.
It does not fit to the end, after a failed send via HTTP you have done to the file is deleted ( sentAtLeastOnce = true). Why do that? In the MASTER, the file remains when a file is again sent to the Internet.

  1. why do not you fix it considers necessary for the MASTER?
  2. In this branch issue-286 - Why did you delete a file with an error if it is not sent?

tnx for answer and help.

@william-ferguson-au
Copy link
Member

@idima

  1. I don't understand your question
  2. I did not change this. That is also the way it is in master. The reason the file is deleted after an attempt to send is to ensure that a user's device doesn't become filled up with an endless series of reports that could not be sent. Note that if none of the senders were able to send the report is deleted then the file will not be deleted.

@ldima
Copy link
Author

ldima commented Jul 13, 2015

sorry William.
i repeat first questions

  1. Why you not commted code in Master? why you not wand do this featrures in Master?
  2. How to limit base by count errors or in disk space #276

"Note that if none of the senders were able to send the report is deleted then the file will not be deleted." - Now I know it !

tnx William.

@william-ferguson-au
Copy link
Member

  1. It hasn't been merged into master yet, because I am waiting for you to verify that it works for you.

@ldima
Copy link
Author

ldima commented Jul 16, 2015

1)Thank you, William. everything works correctly
2)It is a pity that you remove the files which were not sent all the Senders.

@william-ferguson-au
Copy link
Member

The reason that the files are removed as long as they have been sent to one Sender is otherwise if one of the sender fails you would constantly be resending the error to your other server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants