title: How to stop Elmah logging?
body: <p>I am using Elmah.MVC 2 with MVC3, ASP.NET 4.5 on Azure Websites.</p>
  
  <p>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.</p>
  
  <p>My Web.config Elmah sections are :</p>
  
  <pre><code>    &lt;sectionGroup name="elmah"&gt;
    &lt;section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /&gt;
    &lt;section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /&gt;
    &lt;section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" /&gt;
    &lt;section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" /&gt;
  &lt;/sectionGroup&gt;
  </code></pre>
  
  <p>
    </p>
  
  <p>and </p>
  
  <pre><code>&lt;add key="elmah.mvc.disableHandler" value="true" /&gt;
  &lt;add key="elmah.mvc.disableHandleErrorFilter" value="false" /&gt;
  &lt;add key="elmah.mvc.requiresAuthentication" value="true" /&gt;
  &lt;add key="elmah.mvc.IgnoreDefaultRoute" value="false" /&gt;
  &lt;add key="elmah.mvc.allowedRoles" value="Admin" /&gt;
  &lt;add key="elmah.mvc.allowedUsers" value="Admin" /&gt;
  &lt;add key="elmah.mvc.route" value="elmah" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>and</p>
  
  <pre><code>&lt;httpModules&gt;
    &lt;add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /&gt;
    &lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /&gt;
    &lt;add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" /&gt;
  &lt;/httpModules&gt;
  </code></pre>
  
  <p></p>
  
  <p>and</p>
  
  <pre><code>&lt;system.webServer&gt;
  &lt;modules runAllManagedModulesForAllRequests="true"&gt;
    &lt;add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /&gt;
    &lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /&gt;
    &lt;add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>  &lt;elmah&gt;
      &lt;security allowRemoteAccess="yes" /&gt;
      &lt;errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="myDatabaseCS" /&gt;
      &lt;errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" /&gt;
      &lt;/elmah&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I thought this line stopped it:</p>
  
  <pre><code>    &lt;add key="elmah.mvc.disableHandler" value="true" /&gt;
  </code></pre>
  
  <p>But alas not. However I cannot get to the Elmah page ie /Elmah just returns me to the login page.</p>
  
  <p>How can I stop Elmah logging?</p>
  
  <p>Thanks.</p>
  
  <p>EDIT 1:</p>
  
  <p>it may be to do with this in Global.asa:</p>
  
  <pre><code>//filters.Add(new ElmahHandledErrorLoggerFilter());
  filters.Add(new HandleErrorAttribute());
  </code></pre>
  
  <p>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.</p>