Filter on exception text in elmah

前端 未结 2 363
青春惊慌失措
青春惊慌失措 2021-01-01 04:00

Is there a way to filter exceptions in elma using the exception message?

Examples:
\"System.Web.HttpException: Request timed out.\" I don\'t want to filter out a

2条回答
  •  执笔经年
    2021-01-01 04:26

    You can set up an event handler in your global.asax to avoid ugly configuration regex settings:

    void ErrorMail_Filtering(object sender, Elmah.ExceptionFilterEventArgs e) 
    {     
        if (e.Exception.Message.Contains("Request timed out"))
            e.Dismiss(); 
    }
    

    See Error Filtering.

提交回复
热议问题