简单的崩溃报告?
我正在考虑在我的应用程序上实现一个简单的崩溃报告,该报告将询问用户是否愿意将崩溃日志发送给我们。
我以前从未做过崩溃报告,我习惯做的是将错误保存到日志文件中的尝试/捕获。
实现崩溃报告系统的正确方法是什么?
当应用程序崩溃时,如何触发崩溃报告打开并发送转储,或者发送数据的正确方法是什么?
我认为以上是我对其如何工作或应该工作的最大疑问......我不完全确定崩溃报告是否当上述情况发生时,将触发 try/catchs 与外部应用程序的交互,或者遵循它的正确方法是什么。
我没有可用的 SQL Server,因此我计划使用一个简单的上传脚本,报告转储的应用程序将使用该脚本来发送数据。
请原谅我对崩溃报告的工作原理一无所知,我希望社区能够帮助我更好地理解它。
我正在搜索有关崩溃报告的内容,并看到大多数内容都围绕着 Crystal Report,准备好去图书馆等等,但我想从小处开始,这样我就可以在深入研究一些大型库或其他解决方案(如果我可以使用)之前更好地理解它。
I am looking into implementing a simple crash report on my application that will ask the user if he wants or not to send the crash log to us.
I never did a crash report before, what I am used to do is a try/catch around saving the errors to a log file.
What is the correct way to implement a crash report system ?
How do you trigger the crash report to open and send the dump when the application crashs or what is the correct approch to send the data ?
I think the above are my biggest doubts as to how it works or should work... I am not entirely sure if the crash report would be a interact of try/catchs with a external app trigged when the above happens or what would be the correct way to follow it.
I dont have SQL Server available so what I was planning to use would be a simple upload script that the app to report the dump would use to send the data.
Pardon me for my ignorance about how the crash report works and I hope the community can help me understand it better.
I was searching around about crash report and saw most things going around Crystal Report, ready to go libraries, etc but I would like to start it small so I can get a better understanding of it before digging into some big library or other solution if it is available at my end.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否考虑过使用内置的Windows 错误报告?
这篇旧文章可能会感兴趣:A Simple Class to Catch Unhandled Exceptions in WinForms
Have you considered using the built-in Windows Error Reporting?
This old article may be of interest: A Simple Class to Catch Unhandled Exceptions in WinForms
很大程度上取决于应用程序以及(特别是)用户预期的隐私问题。
假设这是一个在用户 PC 上运行的客户端应用程序,如果这是一个“Intranet”内部应用程序,那么让应用程序在退出时通过电子邮件将日志文件发送给您应该非常简单。
这可能非常有趣,因为有时您会在用户报告错误之前修复该错误。
或者,如果您担心应用程序可能崩溃并且无法正确捕获未处理的异常,您可以
如果标记存在,那么您就知道应用程序以不干净的方式崩溃,因此您可以用文本提示用户,例如“上次运行此程序时,它似乎没有正确退出。您想发送一个吗?”记录发生在我们身上的事情,以便我们可以尝试解决可能发生的任何问题?”
Much depends on the application and (in particular) the anticipated privacy concerns of your users.
Assuming this is a client application running on users' PCs, if this is an "intranet" internal application then it should be quite simple to have the application email the log file to you as the application exits.
This can be quite fun, as sometimes you'll fix the bug before users get around to reporting it.
Alternatively, if you're concerned that the application may crash and the unhandled exception won't be caught properly, you could
If the marker is present, then you know the application crashed in an un-clean fashion, so you can prompt the user with text e.g. "Last time you ran this program it didn't appear to exit properly. Would you like to send a log of what happened to us so we can try and fix any problem that might have occurred?"
推出您自己的异常处理程序。在您的program.cs 类中使用以下代码。出现异常时会自动发送邮件。
您可以通过从 https://crashreporterdotnet.codeplex.com 获取基于此的崩溃报告库来节省时间
Roll your own exception handler. Use below code in your program.cs class. It will automatically Send mail when exception occurs.
You can save your time by getting crash report library based on this one from https://crashreporterdotnet.codeplex.com
尝试使用 AppDomain.UnHandledException 和/或 AppDomain.ThreadException
Try to use AppDomain.UnHandledException and/or AppDomain.ThreadException