Is it possible to log frontend (React) errors to backend (Node JS) using Bunyan?

687 views Asked by At

Recently I have been setting up logging for my web app. I am using NodeJS in the backend and using Bunyan to log any errors and etc there. I want to be able to also write any console logs and client errors from the frontend to the same file. Is this possible? or if you have any suggestions that would be great.

Backend logging is currently working and is logging to a file as intended. I want to log any errors and etc from frontend to the same file.

Cheers

1

There are 1 answers

0
Jkarttunen On

You can add a api/route that fron-end code calls and that route uses Bunyan to logs the message received.