protected virtual void OnError(object sender, EventArgs args) { var application = (HttpApplication) sender; LogException(application.Server.GetLastError(), new HttpContextWrapper(application.Context)); }