I have an error page here SiteError.aspx, and it is correctly configured in web.config to go there when unhandled exceptions are encountered.
I want to use this page to log the exception that caused it, because I only want to log errors that users encounter (i.e. if SiteError.aspxit ever comes across.)
This is the code I have:
In OnLoad(...)inSiteError.aspx
Exception lastEx = Context.Server.GetLastError();
if (lastEx != null)
log.Error("A site error was encountered", lastEx);
However, my log never appears in my output, and if I breakpoint on line 2 (in this example), the execution of the code never stops (after throwing an exception for ASP.NET handling in the debugger.
Arena source
share