Tuesday, October 11, 2011

Elmah Error Filtering(Ignore Some Exceptions)


Open the Global.asax file then write code;

void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e)
        {
            if (e.Exception.GetBaseException() is FileNotFoundException || e.Exception.GetBaseException() is HttpException)
                e.Dismiss();
        }

No comments:

Post a Comment