Importing Javascript errors from log files


#1

Hi!

On our setup we log all frontend errors to backend and they end up written to log files. I have timestamp, application name, version, error message and stacktrace.

I can easily read these logs in Node.js application, but should I re-implement whole browser SDK to get these errors properly stored in Sentry?

Has anyone dealt with similar setup before? What would be reasonable approach to import errors from log files to Sentry?


#2

Sending an event is a single POST request. Considering that this functionality is the only part you would be able to reuse from existing SDKs, I think it would be easier for you to just use curl: How can I post with curl a sentry event? Which authentication credentials?

Take a look at https://docs.sentry.io/development/sdk-dev/attributes/ to know which keys exist in the JSON payload.