Android 中应用程序特定的日志记录和导出
我的应用程序目前使用 logcat 记录调试信息和手机状态。我需要的是:
- 有没有一种方法可以将我的所有日志发送到我的应用程序的私有(例如加密)存储,而其他人无法以简洁的方式访问该存储?
- 我还想清理并导出这些日志,例如每 24 小时导出一次到我的 TCP 服务器,
最快、最干净的方法是什么?我知道我可以编写自定义日志服务来执行此操作并使用 AlarmManager 之类的东西来导出日志,但我想知道是否存在自动化解决方案,因为任务本身似乎相当普遍。
所有这一切背后的想法是监控我的应用程序的性能,可能的错误,这将使我能够进行更新。类似于自动众包反馈之类的东西。
My app logs debug information and phone state using logcat at present. What I need is the following:
- Is there a way to send all my logs to my app's private (say encrypted) storage not accessible to others in a neat fashion?
- I would also like to clean up and export these logs, say once every 24 hrs to my TCP server
What would be the quickest and the cleanest way to go about doing this? I understand that I could write my custom logging service that does this and use something like an AlarmManager to export the logs, but I was wondering if there exist automated solutions since the task itself appears to be quite ubiquitous.
The idea behind all this is to monitor the performance of my app, possible bugs which would enable me to work on updates. Something like automated crowd sourced feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Google Analytics,它“提供网络服务和一对 SDK,以帮助跟踪用户与从移动设备访问的网站和应用程序的交互”
链接:http://code.google.com/mobile/analytics/docs/android/
此外,导致应用程序强制关闭的实际错误将显示在您的 Android 开发者帐户,其详细信息与 logcat 中的相同。
You could use Google Analytics which "provides a web service and a pair of SDKs to help track user interaction with websites and applications accessed from a mobile device"
Link: http://code.google.com/mobile/analytics/docs/android/
Also, actual errors that cause your app to force close will show up in your android developer account, with the same detail as in logcat.