添加到错误消息的有用值 .NET

发布于 2024-07-27 02:41:34 字数 147 浏览 4 评论 0原文

在我的应用程序范围的错误处理中,我返回主机名以查看它发生在哪台计算机上、应用程序版本、Windows 版本、包含所有内部异常的异常以及堆栈跟踪。

在 MyApplication_UnhandledException 方法中您可以获得哪些其他信息对跟踪错误有用?

On my application wide error handling I'm returning the host name to see what computer it happened on, application version, windows version, exception with all inner exceptions, and the stack trace.

What other information can you get while inside the MyApplication_UnhandledException method that would be useful for tracking down an error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦屿孤独相伴 2024-08-03 02:41:34

如果使用log4net之类的东西,就可以获得线程信息,事实证明是在不止一次追踪难以捉摸的错误时很有用。

If you use something like log4net, you can get thread information, which has proved to be useful on more than one occasion for tracking down an elusive bug.

半山落雨半山空 2024-08-03 02:41:34

例如,您可能想要查看 ASP.NET 运行状况监控在处理未处理的异常时在事件日志中放置的内容。 另请查看企业库,了解日志记录应用程序块允许您添加哪些内容。

As an example, you might want to look at what ASP.NET Health Monitoring places in the event log when it processes an unhandled exception. Also look at Enterprise Library to see what the Logging Application Block permits you to add.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文