2016-03-25 1 views
1

現在、ELMAHのエラーログでは、404エラーを排除/削除する必要があります。これは、無駄で、データベースストレージを消費するためです。ELMAHから404を除外する方法

どのようにして404を除外するか、特にweb.configを通して考えてみましょうか?

+0

[不要な404エラーをレポートELMAH]の可能な重複(http://stackoverflow.com/questions/2071389/elmah-reporting-unwanted-404-errors) –

答えて

1

あなたは簡単に以下のサイトのWeb構成ファイルに設定されたことにより、404エラーをスキップすることができます。

<elmah> 
    <security allowRemoteAccess="yes" /> 
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah-ErrorLog" applicationName="YourAPPName" /> 
    <errorFilter> 
     <test> 
      <or> 
       <regex binding="Exception.Message" pattern="Server cannot modify cookies after HTTP headers have been sent\." /> 
       <equal binding="HttpStatusCode" value="404" type="Int32" /> 
      </or> 
     </test> 
    </errorFilter> 
</elmah> 
関連する問題