【问题标题】:How to cancel event on the bugsnag in C#?如何取消 C# 中 bugsnag 上的事件?
【发布时间】:2021-07-13 10:39:48
【问题描述】:

如何在 C# 中取消有关 bugsnag 的事件 我尝试了类似下面的方法,但它不起作用

    func(event *bugsnag.Event, config *bugsnag.Configuration) error {
        for _, datum := range event.RawData {
            if user, ok := datum.(*MyUserInfo); ok {
                event.User = &User{Id: user.Id}
            }
        }
    }) ```

【问题讨论】:

    标签: asp.net sitecore bugsnag


    【解决方案1】:

    你可以像下面的代码那样做:

    Bugsnag.AspNet.Client.Current.BeforeNotify(report =>
                {
                    if (report.Event.Request.Url.Contains("healthcheck.aspx"))
                    {
                        report.Ignore();
                    }
                });
    

    【讨论】:

      猜你喜欢
      • 2013-01-10
      • 2016-06-15
      • 2012-03-22
      • 2021-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多