protected void Application_Error()
{
var error = Server.GetLastError();
try
{
Log.ErrorFormat(
CultureInfo.InvariantCulture,
"Server error has been occured while processing page: {0} ",
error,
HttpContext.Current != null ? HttpContext.Current.Request.Url.ToString() : "unknown");
}
catch (Exception ex)
{
Trace.TraceError(ex.Message);
}
this.HandleCustomErrors(error);
}