通过互联网向开发人员发送应用程序错误和日志的最佳方式是什么?
作为 C# 应用程序的作者,我发现如果我能够访问异常或调试日志,对用户报告的问题进行故障排除会容易得多。
我已经包含了一个本地日志记录机制,用户可以打开或关闭该机制。 我希望用户能够通过互联网提交日志,以便我可以查看日志中的错误。
我考虑过使用 SMTPClient 或 网络服务 来发送信息。 SMTPClient 可能无法工作,因为防火墙可能会阻止传出 SMTP 访问。 Web 服务在发送大量数据(可能超过 1 MB)时会出现问题吗?
您建议将应用程序直接传输错误报告给开发人员进行审查的最佳方式是什么?
编辑:澄清:这是一个Windows应用程序,当发生错误时,我想弹出一个对话框,要求提交错误。 我的问题是关于通过互联网将错误日志从应用程序传输给我(开发人员)的机制。
As the author of a C# application, I found that troubleshooting issues reported by users would be much easier if I had access to the exception or debug logs.
I have included a home-grown logging mechanism that the user can turn on or off. I want the user to be able to submit the logs via the internet so I can review the logs for the error.
I have thought of using either SMTPClient or a web service to send the information. SMTPClient might not work because firewalls may block outgoing SMTP access. Would a web service has issue with sending a large amount of data (potentially 1+ MB)?
What would you recommend as the best way to have an application transmit error reports directly to developers for review?
EDIT: Clarification: This is a Windows application and when an error occurs I want to bring up a dialog asking to submit the error. My question is about the mechanism to transmit the error log from the application to me (developer) via the internet.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
通过某种方式让用户知道您打算这样做。 向他们索要代理,向他们索要电子邮件服务器,诸如此类。
如果具有安全意识的人发现您正在打开套接字或类似的东西并在没有通知的情况下发送数据,他们会感到非常紧张。
确实如此。
Some way that let's the user know you mean to do it. Ask them for a proxy, ask them for an email server, something like that.
The security minded will get real nervous if they discover that you're opening a socket or something like it and sending data out without notification.
And rightly so.
我建议不要发送所有内容(对您的申请的整个审核)。
但只要用户想要(“反馈”按钮)或者应用程序中存在明确的异常、致命错误、问题状态。
我们使用了 Web 服务和电子邮件 (SMTPClient)。 的看法
我对这些网络服务
好
坏
有了这些东西)
SMTP客户端
好
--> HTML
不好
I would suggest NOT to send everything (the whole audit of your application).
But just if the user wants it ("Feedback" button) or if there is an explicit exception, fatal error, problem state in the application.
We used both Web services and email (SMTPClient). My thoughts on these
Web service
GOOD
BAD
with these things)
SMTPClient
GOOD
--> HTML
BAD
我们使用 3 种方法将
祝你好运。 你是对的,如果你有堆栈跟踪,甚至可能是可怜的老用户正在做什么的屏幕截图,那么调试就会容易得多。
We use 3 methods where I work
Good luck. You're right in that it's much easier to debug if you've got the stack trace and perhaps even a screenie of what the poor old user was doing.
您可以自己编写它,也可以使用诸如 log4net 之类的东西,它会为您处理异常日志记录...
You can write it yourself, or you can use something like log4net, it takes care of the exception logging for you...
我喜欢将此类内容作为电子邮件接收到专用邮箱。 这样我就可以轻松地归档、搜索或忽略它。
在客户端/发送方方面,我认为提供发送日志的弹出窗口是一个好主意。 如果是 Windows,您可以使用 MAPI 发送电子邮件。 在 UNIX 系统上,“邮件”问题适用于大多数系统。
您可以在确认消息中提示用户输入电子邮件地址,并可能提供一些有关如何发送电子邮件的选项(包括复制/粘贴到他们选择的邮件客户端中)。
您不应该做的一件事是在未经用户许可的情况下发送信息。
I like to receive stuff like this as email to a dedicated mailbox. That way I can easily archive it, search it, or ignore it.
On the client/sender side, I think a pop-up offering to send the logs is a good idea. If windows, you can use MAPI to send the email. On a unix system "mail" problem works on most systems.
You can prompt the user for an email address in the confirmation message, and maybe offer a few options on how to send it (including copy/paste into the mail client of their choice).
One thing you should NOT do is send the information without the user's permission.
如果您不希望在一天内发送很多报告...您可以创建一个 Gmail 帐户并使用它来发送电子邮件,以避免强制用户配置 SMTP 服务器。 不确定 Gmail 的条款和条件是如何执行此操作的。
这是我编写的一个类,它使用 gmail 帐户发送电子邮件...
显然这里存在一些安全问题,例如有人可能会访问您的 gmail 帐户。 因此,请考虑到这一点。
该类中有一些方法可以同步或异步发送电子邮件。
If you aren't expecting that many reports to be sent in a single day... you could create a gmail account and use that to send the emails to get around having to force the user to configure an SMTP server. Not sure what gmail's terms and conditions are for doing this.
Here is a class which I wrote which sends an email using a gmail account...
Obviously there are some security issues here like someone could potentially get access to your gmail account. So, take that into consideration.
There are methods in this class to send the email synchronously or asynchronously.