【问题标题】:Is there a way to catch the logs from Sentry and post them to my custom Backend?有没有办法从 Sentry 捕获日志并将它们发布到我的自定义后端?
【发布时间】:2022-01-06 03:06:29
【问题描述】:

我将 Sentry 集成到我的 Angular 应用程序中。

有没有办法从 Sentry 捕获日志并将它们发送到自定义端点?

目标是将 Sentry Dashboard 和我的后端(使用 Java Springboot 构建)结合起来

感谢您的帮助!

【问题讨论】:

    标签: angular typescript spring-boot error-handling sentry


    【解决方案1】:

    尝试使用 beforeSend

    Sentry.init({
      ...
     
      beforeSend(event) {
        // Send here 
        fetch('https://yourwebsite.com/someapi', { method: 'POST', body: JSON.stringify(event)})
        return event;
      },
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-24
      • 2022-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多