1

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!

Diego Perez
  • 2,188
  • 2
  • 30
  • 58

1 Answers1

1

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

GuilhermeFGL
  • 2,891
  • 3
  • 15
  • 33
  • Thank you very much @GuilhermeFGL. I will take a look at it. But where do Crashlytics store logs? In a database? It sends them by mail? or how? – Diego Perez Aug 04 '17 at 17:40
  • My pleasure =) it is a very complete and simple to implement tool indeed – GuilhermeFGL Aug 04 '17 at 17:43
  • Crashlytics is a service. It can be accessed online. However, I think it might have an email report setup in some places – GuilhermeFGL Aug 04 '17 at 18:01
  • OK, now I've seen Crashlytics use it's own dashboard to show user logs so you create an account and get an API key like in most APIs. Haven't tested yet but looks like a small and neat solution so I will accept your answer. Thanks @GuilermeFGL!! – Diego Perez Aug 05 '17 at 12:19