I am using Elmah.MVC 2 with MVC3, ASP.NET 4.5 on Azure Websites.
I have set it up to log, via the web.config, to XML files on the webserver. This all works. However I want to stop it temporarily, as I believe it may be slowing the web server, since it is taking up time writing these error files. I plan to log to SQL Server. But for now I need to stop Elmah.
My Web.config Elmah sections are :
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
and
<add key="elmah.mvc.disableHandler" value="true" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="Admin" />
<add key="elmah.mvc.allowedUsers" value="Admin" />
<add key="elmah.mvc.route" value="elmah" />
and
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
and
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
and
<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="myDatabaseCS" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>
</configuration>
I thought this line stopped it:
<add key="elmah.mvc.disableHandler" value="true" />
But alas not. However I cannot get to the Elmah page ie /Elmah just returns me to the login page.
How can I stop Elmah logging?
Thanks.
EDIT 1:
it may be to do with this in Global.asa:
//filters.Add(new ElmahHandledErrorLoggerFilter());
filters.Add(new HandleErrorAttribute());
THe first line is commented out as I do not believe it is required in V2. All error handling is now merged with Elmah I believe.
Just remove the <errorLog> elements from your <elmah> section. Or comment it out. This will disable the logging functionality, and all you have to do to restore functionality when you want it is add those <errorLog> elements back in again. This way, you don't have to remove any of the core Elmah components that could lead to problems later on when you want to restore functionality, particularly if you miss something.
Just to note - removing <errorLog> from <elmah> in web.config does not stop the logging, it just reverts it to in-memory logging as described in this SO answer. (cannot comment on the accepted answer due to insufficient rep.)
If the intent is to stop logging entirely, you can use the Elmah's ErrorFilterModule (assuming that it is added in web.config) for that, like so (global.asax.cs excerpt):
protected void ErrorMail_Filtering(object sender, ExceptionFilterEventArgs e)
{
e.Dismiss();
}
Related
Is there a way to disable or bypass Azure Active Directory while I'm developing my application? I've tried the following and it still redirects to AAD for authentication.
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
//IdentityConfig.ConfigureIdentity(); commented out for dev. 12/12/2014
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
//private void WSFederationAuthenticationModule_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e)
//{
// if (!String.IsNullOrEmpty(IdentityConfig.Realm))
// {
// e.SignInRequestMessage.Realm = IdentityConfig.Realm;
// }
//}
I commented out the methods in the IdentityConfig.cs, still redirects to AAD.
Advice is much appricated.
This is my web.config:
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ida:FederationMetadataLocation" value="https://login.windows.net/accountname.onmicrosoft.com/FederationMetadata/2007-06/FederationMetadata.xml" />
<add key="ida:Realm" value="https://accountname.onmicrosoft.com/application.WebUI" />
<add key="ida:AudienceUri" value="https://accountname.onmicrosoft.com/application.WebUI" />
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=+mykey==" />
</appSettings>
<system.webServer>
<modules>
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" />
<wsFederation passiveRedirectEnabled="true" issuer="https://login.windows.net/onalabama.onmicrosoft.com/wsfed" realm="https://onalabama.onmicrosoft.com/Procurement.WebUI" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>
This solution is not very general, but might be just want you want if you are deploying to Azure Web Sites. You can ask Azure Web Sites to enforce authentication with an AAD before allowing users to reach your site.
Basically, you can develop locally WITHOUT any AAD in your code, and deploy that way too. Authentication is instead configured for the Azure Web Site - no code needed - after you configure it on the CONFIG tab in the Azure portal.
Here is a nice writeup: http://azure.microsoft.com/blog/2014/11/13/azure-websites-authentication-authorization/
There are some current limitations (see the article), but I've found this handy in a few situations already.
I have a .NET application which uses some images stored in a folder on a server. the folder does not belong to my application. The images in this folder are used as background images of some div within the application. I published the image folder to the web along with my application and so everything work fine. However, Is there a way to limit the access of the folder to my .net application or a setting that can be set so that the content of the folder is not browsable/searchable? Right now, my application uses a url like www.domain.com/iisfoldername/picture.png to set the background of divs. Similarly if you use such URL in a browser, an image will be served. Is it possible to prevent this URL from being served when it is not requested from my application? That is, if someone enters this url in the browser, the image is not displayed, but the image displays when my application requests it.
I know of setting a authentication for a folder. But How can I limit an http request to a user and then impersonate this user(if possible)?
'
EDIT
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<section name="system.identityModel.services" type="System.IdentityModel.Services.Configuration.SystemIdentityModelServicesSection, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</configSections>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ida:FederationMetadataLocation" value="https:ccc.com/Federation.xml" />
<add key="ida:Issuer" value="https://ccc.com" />
<add key="ida:ProviderSelection" value="productionSTS" />
</appSettings>
<location path="Federation">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<authorization>
<deny users="?" />
</authorization>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<!--Commented by Identity and Access VS Package-->
<!--<authentication mode="Forms"><forms loginUrl="~/Account/LogOn" timeout="2880" /></authentication>-->
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
<httpRuntime targetFramework="4.5" requestValidationMode="4.5" />
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" applicationName="/" />
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
</providers>
</sessionState>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.4.3.0" newVersion="5.4.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<connectionStrings>
</connectionStrings>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
<add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
</modules>
</system.webServer>
<system.identityModel>
<identityConfiguration>
<audienceUris>
<add value="https://localhost/App/" />
</audienceUris>
<!--Commented by Identity and Access VS Package-->
<!--<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry"><authority name="LocalSTS"><keys><add thumbprint="9B74CB2F320F7AAFC156E1252270B1DC01EF40D0" /></keys><validIssuers><add name="LocalSTS" /></validIssuers></authority></issuerNameRegistry>-->
<!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
<certificateValidation certificateValidationMode="None" />
<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
<authority name="http://ccc.com">
<keys>
<add thumbprint="BA86062DD810B95F49FBF85F448507D63D15FB92" />
</keys>
<validIssuers>
<add name="http://ccc.com" />
</validIssuers>
</authority>
</issuerNameRegistry>
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" />
<wsFederation passiveRedirectEnabled="true" issuer="https://ccc.com/" realm="https://localhost/App/" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>
</configuration>
Given your configuration, I believe your best option is to use URL rewriting. In this case, redirect users to a "fake" image if they are requesting images directly or as referred from some other website (but allowing access to them if referred from a page in your application).
To accomplish this, use Microsoft's IIS URL Rewrite extension, which you can download here:
http://www.iis.net/downloads/microsoft/url-rewrite
Once it is installed on your server, configure it by adding the following to your web.config (since you already have a system.webServer section in your web.config, just add the "rewrite" node into it). Note the inline comments and replacements required.
<system.webServer>
<rewrite>
<rules>
<rule name="Whitelist Image Access" stopProcessing="true">
<!-- Evaluated for all image file requests -->
<match url="(?:jpg|jpeg|png|gif|bmp)$" />
<conditions>
<!--
Rule applies when user tries to access URL directly (no referrer)
-->
<add input="{HTTP_REFERER}" matchType="Pattern" pattern="^$" ignoreCase="true" />
<!--
Rule does NOT apply when pages on our site are the referrer
*** NOTE: Replace "ccc" and "com" with appropriate parts form your domain ***
-->
<add input="{HTTP_REFERER}" matchType="Pattern" pattern="^https?://(.*\.)?ccc\.com/.*$" ignoreCase="true" negate="true" />
<!--
Rule does NOT apply when accessing the replacement image when real ones are refused
*** NOTE: replace "no_access.png" with the name of the "fake" image you want to use ***
-->
<add input="{REQUEST_FILENAME}" matchType="Pattern" pattern="no_access.png" ignoreCase="true" negate="true" />
</conditions>
<!--
Temporary redirect (status code 307) to "fake" image
*** NOTE: Replace the URL below with the "fake" image URL ***
-->
<action type="Redirect" url="http://ccc.com/images/no_access.png" appendQueryString="false" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
</system.webServer>
using .net mvc 3 and trying to increase the allowable file upload size.
This is what I've added to web.config:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600"/>
</requestFiltering>
</security>
*ignore the elmah stuff.
it's still not allowing file sizes larger than 50MB and this should allow up to 100MB no?
any ideas?
In case other people stumble across this later on, you can also set a max file size for specific routes. This is what I have in my one project.
<configuration>
<!-- This will allow this setting only for this one action method. -->
<location path="Attachment/HandleUpload">
<system.web>
<!-- I needed to set for 20 MB. -->
<httpRuntime maxRequestLength="20480"/>
</system.web>
</location>
<!-- other configuration settings here, including appSettings -->
</configuration>
So I've been using elmeh forever.
I've got an app I've recently converted to MVC3 .net4, and vs2010, and it's developed on a server 2008 box (as opposed to my other apps developed on an XP box).
I set up elmah normally and it does not work...
I've got a reference to ELMAH.dll already, it's in my CommonDLLs folder.
I add the sectiongroups
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
I add the sections
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/ELMAH" />
<!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />-->
<errorMail from="change.me#CCCC.org" to="brown.ericw#CCCC.org" subject="Application: StudentPortal3G, Environment:Dev, ServerBoxName: Dev" async="true" />
</elmah>
I add the module and handlers
<httpHandlers>
<add verb="*" path="*.pdfx" type="JCDCHelper.Web.UI.RunAsASPXHandler, JCDCHelper.Web" />
<add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
</httpModules>
I add the SMTP section for Email support
<system.net>
<!--Required for Elmah Mail Processing-->
<mailSettings>
<smtp deliveryMethod="Network">
<network host="10.10.10.10" port="25" defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
I goto the "~\ELMAH" folder, select my machine, and give the network service account full control of the folder (did the same for Everyone, just in case)
I set up the routing for elmah.axd to go throguh as a web page.
routes.IgnoreRoute("elmah.axd");
I add a location tag, so I can hit elmah.axd without being logged in
<location path="elmah.axd">
<system.web>
<authorization>
<!--<deny users="?" /> in prod and qa change to this, otherwise anyoen can look at the logs - EWB-->
<allow users="*" />
</authorization>
</system.web>
</location>
But I get nothing, no elmah emails, no XML logs in the ELMAH folder, and a 404 when I goto elmah.axd
What am I missing? ANy help is appreaicted.
Thanks,
Cal-
Under IIS7 you need to add the httpHandlers and httpModulea under the system.webserver node of the web.config.
This thread should help: http://groups.google.com/group/elmah/browse_thread/thread/4bbef2f26e0c5fd1
I'm not finding this to be easy to setup; either there is a missing step in the setup configuration, it isn't work correctly, or I don't actually understand it's purpose. There is something definitely wrong here. The problem must obviously be me. I'm just not getting this to work. Here's what I've done.
Create a brand new mvc application.
Placed the following on the About.aspx page.
<% throw new Exception("blah"); %>
Put content here.
Hit the page get the yellow screen with the exception.
Add elmah.dll to bin directory.
Add to the Web.config file configurationSections:
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
Add to the httpHandlers section the following:
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
Add to the modules section:
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
Add to the handler section:
<add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" preCondition="integratedMode" type="Elmah.ErrorLogPageFactory, Elmah"/>
Add an elmah section:
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>
What is curious here is that the ".XmlFileErrorLog" part of that string show up red as a ReSharper error indicating that it "Cannot resolve symbol '.ctor'" which when I look at the elmah.dll in Reflector shows this object to require either a "string" or an "IDicationary" in either of the two public constructors.
I'm running Windows Vista x64 with VS 2008. Set permission on the App_Data to Everyone as Co_Owner.
The http://localhost:xxxx/elmah.axd page does come up and shows no errors. When I hit my "About" page again I still see yellow screen and elmah.axd still shows no errors the app_data folder .
I substituted the customerrors with and created associated page:
<customErrors mode="On" defaultRedirect="GenericErrorPage.htm" />
The custom page shows but elmah.axd still shows "No Errors". App_data still empty!
As source to start this setup I used:
code.google.com/p/elmah/wiki/MVC
So where am I messed up at?
~-=Mike=-~
Check if ErrorLogModule is present in both configuration/system.web/httpModules (used if you are on Development Web Server) and configuration/system.webServer/modules (used by IIS7). Here is the fragment of web.config from project, I'm currently working on:
<?xml version="1.0"?>
<configuration>
<system.web>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="ErrorLog" />
<remove name="ErrorMail" />
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
</modules>
</system.webServer>
</configuration>
Hope this helps
Try removing this section:
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
</elmah>
This will mean that Elmah is setup to just use the default in-memory logging. This help trouble shooting because you know it isn't a file permission thing. So once you've got it working with in-memory logging you can then set it up to log to a xml file.
You may also want to check out this stackoverflow question, How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?, that was answered by Atif Aziz himself.
HTHs,
Charles
I installed from nuget elmah and elmah on XML log, didn't got the expected funcionality although I could access http://localhost/elmah.axd, but no error capturing.
I gave write permission to the account IIS_IUSERS in the folder APP_DATA and it started working for HTTP 404 errors and the errors that are outside MVC infrastructure. But it did not log exceptions inside the mvc. The solution was installing elmah.mvc package from nuget and it started capturing all exceptions.
If your config is OK, then just install the elmah.mvc package from nuget and it should start storing logs also inside mvc, not just HTTP 404.
The problem is this line
<customErrors mode="On" defaultRedirect="GenericErrorPage.htm">
Replace it by
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">