Can any one tell me how to log each and every request in react js and redux on client side for logging my errors in a file and also logging component life cycle structure ?
-
I hope this package would help you : github.com/evgenyrodionov/redux-loggersoywod– soywod2017-04-17 16:04:37 +00:00Commented Apr 17, 2017 at 16:04
-
You can use Sentry to log errors (not a file, but to a server). As for component life-cycle, you can add breadcrumbs to your errors: docs.sentry.io/learn/breadcrumbs. Not sure if this is what you're looking for, so leaving a comment instead of an answer.ehfeng– ehfeng2017-04-17 20:55:52 +00:00Commented Apr 17, 2017 at 20:55
-
@ehfeng i am new to react and redux , i want to log all the activies what my client is doing, wether anything happening on client side or server side. I want to log every component request which is made as well as all component lifecycle methods called ...I want to log them all ... Hope you got my issue now ..Diljeet Kakkar– Diljeet Kakkar2017-04-18 09:37:00 +00:00Commented Apr 18, 2017 at 9:37
-
For most situations the log in browser is good enough. You can export it from most browsers too.Sulthan– Sulthan2017-04-19 12:16:22 +00:00Commented Apr 19, 2017 at 12:16
Add a comment
|
1 Answer
You can apply the redux-logger as a middleware when creating the store. You can wrap the dispatch to log the actions. Have a look at this tutorial:
https://egghead.io/lessons/javascript-redux-wrapping-dispatch-to-log-actions