Log-Driven Development solves all of these problems. The idea is that by driving the business logic of an app via logs, we are able to automatically capture information that helps us reproduce bugs, resolve user issues, and understand user behavior without additional work.
Using Redux makes this very easy: we can just log everything and then search and investigate our logs later.
Here are a few examples of how we use Log-Driven Development at LogRocket:
Scenario 1: Reproducing Bugs
We use crash reporting tools and we get a bunch of errors that look something like this:
We don’t have enough information here to reproduce the bug. However, since we are using Redux in our app, we capture the series of events that led to the problem in LogRocket:
Scenario 2: Resolving User Issues
The other day, a user told us that they were having difficulty logging in. Normally I’d have to ask a bunch of clarifying questions: “What account are you using?”, “Can you send us a screenshot?”, “Have you tried incognito mode?” In this case, we had captured all of the information in logs, and we discovered the fix without back-and-forth. Success!
Scenario 3: Understanding User Behavior
Our product manager works really hard to understand what makes our users successful. He set up Heap to be able to retroactively analyze interactions, but we found that there were still a number of events that he had to ask us to manually tag in the app. I set up a Redux middleware to send all of our events to Segment: https://github.com/rangle/redux-segment and we haven’t had a problem since 🙂
Getting Started With Log-Driven Development
- Use Redux
- Use Redux libraries for your app’s business logic:
redux-query for REST APIs
apollo-client for GraphQL APIs
redux-saga for asynchronous events
- Use LogRocket to capture log data in production
Cut through the noise of traditional error reporting with LogRocket
LogRocket is a digital experience analytics solution that shields you from the hundreds of false-positive errors alerts to just a few truly important items. LogRocket tells you the most impactful bugs and UX issues actually impacting users in your applications.
Then, use session replay with deep technical telemetry to see exactly what the user saw and what caused the problem, as if you were looking over their shoulder.
LogRocket automatically aggregates client side errors, JS exceptions, frontend performance metrics, and user interactions. Then LogRocket uses machine learning to tell you which problems are affecting the most users and provides the context you need to fix it.
Focus on the bugs that matter — try LogRocket today.