有没有办法向 Flex Air 应用程序添加详细的远程崩溃报告?
我很快就会发布我的 Air/Flex 应用程序,但我非常确定 Air 可用的各种平台上可能会出现一些错误。所以我想知道是否有一种方法可以实现一种机制,每次应用程序崩溃时都会向远程服务器发送错误报告,记录错误发生的位置?这样我可能会发现否则会被忽视的错误。
I will be releasing my Air/Flex application soon, but I am pretty sure there are a couple of bugs that may pop up on the various platforms that Air is available for. So I was wondering if there is a way to implement a mechanism, that would send an error report, logging where the error happened, to a remote server each time an app crashes? This way I might catch errors that otherwise would go unnoticed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Flash 10 和 AIR2 现在支持全局错误处理。有关详细信息,请访问:http://help。 adobe.com/en_US/air/reference/html/flash/events/UncaughtErrorEvent.html
使用此类功能来捕获未捕获的异常;您可以将跟踪提交到专门设置的某些 Web 服务来获取它们。使用 Google App Engine 非常适合此目的,因为它已经具有日志记录功能,可以从调用应用程序的客户端获取各种元数据。另外,如果您的日志由于某种原因变得很大 - 至少您不必担心存储它们。 Google 会为你做到这一点:)
我已经设置了如下所述的这样一个服务(假设它有一些缺陷,特别是任何人都可以调用它并添加“痕迹”,但你可以添加一些共享秘密并通过 HTTPS 发布以拥有一些微小的安全措施)。
App Engine 日志服务
我编写了一个包含这个小测试函数的小 AIR-应用程序,该函数只是使用指定的参数“trace”对应用程序引擎服务进行 POST:ed。
发布到日志记录服务 (ActionScript)
最后,这就是它在日志、大量元数据以及您在 AIR 应用程序中捕获的跟踪中的外观。
Global error handling is now supported in Flash 10 and AIR2. More info on that here: http://help.adobe.com/en_US/air/reference/html/flash/events/UncaughtErrorEvent.html
Using that kind of functionality to catch uncaught exceptions; you can submit the trace to some web service set up specifically to grab them. Using Google App Engine is excellent for this purpose since it already has a logging feature which grabs all kinds of meta data from the client calling the application. Also, if your logs become huge for some reason - at least you wont have to worry about storing them. Google does that for you :)
I've set up such a service as outlined below (granted it has some flaws, in particular anyone can call it and add "traces", but you could add some shared secret and post over HTTPS to have some tiny measure of security).
App Engine Logging Service
I wrote a little AIR-app containing this little test function which simply POST:ed the app engine service with the parameter "trace" specified.
Posting to the logging service (ActionScript)
And finally, this is how it looks in the logs, lots of metadata, and of the trace you caught in your AIR app.