.Net捕捉配置或程序错误
1 protected void Application_Error(object sender, EventArgs e) 2 { 3 Exception objError = Server.GetLastError(); 4 string s = string.Empty; 5 if (objError.InnerException != null) 6 s = objError.InnerException.ToString(); 7 _logger.Error(LogSourceName, "System Error. " + objError.Message + s, objError); 8 }