I have a live application in the market.
I want to add to it an option for my users to report bugs, and attach the relevant logcat output from around the time of that event.

I tried saving the last X lines of logcat in a collection, rolling files every X hours and zipping them when user reports a bug.

This approach works well on crashes using UncaughtExceptionHandler, but has a few problems.

* If something is entering an infinite loop, many log lines are written and eventually disappear from my collection since its size is limited
* If app is cleared by the OS, the intermediate log lines are lost.
* These 2 often come together. When the app starts misbehaving in the background, the OS will eventually get rid of it.

Are there any standard solutions or methodologies for that?

**EDIT1:**

Since there are already a couple of answers suggesting tools like Crashlytics or Flurry, I'll clarify the problem.
Crashes are the easy part of error reporting. But sometimes users see problems that are not related to crashes, just things not working properly. I have a settings option for them to report issues, but I want a way for them to also attach logcat output from around this time so I have a better clue about what made my app do what it did.