ASP.NET - 抛出或记录错误 [英] ASP.NET – Error throwing or logging

查看:94
本文介绍了ASP.NET - 抛出或记录错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在C#中构建一个ASP.NET应用程序



我们有3层:UI,Business和Database。我们需要澄清错误处理/记录。我们有一个错误记录框架来记录错误。



我的问题是:我们需要在每个层中记录错误或仅在主调用层(UI层)通过从业务和数据库层将错误引入UI层? 是否有最佳做法?



如果您还可以提供参考文档或Web引用(如果需要) p>

谢谢和祝福...
Sruthi Keerthi。

解决方案


  • 处理您可以在它们发生的层中的任何异常。让那些你不能处理泡沫到UI层。请参阅
    ASP.NET Web应用程序异常处理建议了解更多信息信息。

  • 使用例如 Elmah 的异常记录机制来记录例外情况UI。


We are building an ASP.NET application in C#

We have 3 layers: UI, Business and Database. We need clarification on error handling/logging. We have a error logging framework to log errors.

My question is: do we need to log errors in each layer or only in the main calling layer (UI layer) by throwing the errors to UI layer from business and database layers? Is there a best practice?

If would be great if you could also provide a reference document or web references (If needed).

Thanks and Regards … Sruthi Keerthi.

解决方案

这篇关于ASP.NET - 抛出或记录错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆