Reputation: 58
I want log all the client side errors in a centralised logging file .Can anyone tell me how to do this in react.(Client side error logging).I am not able to find support for this in react.Can anyone tell how to implement it by a small demo
Upvotes: 1
Views: 3169
Reputation: 3908
As others have commented on, React
runs in the browser and on the client side, so writing files is not possible.
However, I was searching myself for centralised logging for a frontend application and came across this post. Perhaps the question is not asked correctly, but basically I wanted to log and report crashes in the frontend to a central place or dashboard. When the app users run into issues, I at least know by seeing these errors in the dashboard. I found a few websites / services that can do this for you.
First tear is a free subscription
First tear is paid
I've used this list myself to do some research and thought to share it here for anyone else who might currently be in my position. Perhaps it will help you along and you find it useful. Examples of how to implement them are in the docs. See which solution works best for you.
Upvotes: 4