Job*_*mno 5 c# asp.net-mvc asp.net-mvc-3
我的 Global.asax.cs 中有这个 Application_Error 事件,它将获取我的应用程序中发生的任何未处理的异常。我能够收到错误消息。我想要获取的是发生异常的类名和方法名,以便更容易跟踪异常的位置和原因。请帮忙。
全局.asax.cs
protected void Application_Error(object sender, EventArgs e)
{
var errMsg = Server.GetLastError().Message;
if (string.IsNullOrWhiteSpace(errMsg)) return;
//Get Class name and method name
//ErrorLog.SaveLog(errMsg, Classname, Methodname);
Context.ClearError();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5198 次 |
| 最近记录: |