Marci
Marci

Reputation: 13

Is there a way to catch the logs from Sentry and post them to my custom Backend?

I integrated Sentry into my Angular Application.

Is there a way to catch the logs from Sentry and send them to a customized endpoint?

The target is to combine the Sentry Dashboard but also with my Backend (built with Java Springboot)

Thanks for the help!

Upvotes: 0

Views: 608

Answers (1)

Bojan Kogoj
Bojan Kogoj

Reputation: 5649

Try using beforeSend

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

Upvotes: 1

Related Questions