We're a small team running Node for our backend. Using a combination of LogDNA, FullStory, Sentry and Mixpanel across frontend and backend.
Problems I face:
Can't trace user journey: User reports a bug. I look through logs with a timestamp of the user report, but can't trace the user journey, especially with lots of asynchronous operations going on in parallel
Insufficient logging: I can identify the error being thrown but can't identify the cause. Would want to see logs of surrounding code which we maybe didn't log
To solve this, I've resorted to adding logging around the suspected problem path, pushing to production and asking the user to try again (very annoying for them)
Any best practices I'm missing or is this really the best way to be debugging issues in prod?
what you need is centralized logging with ELK stack if you're using AWS at all or simple use a SASS tool such as Logz.io or Loggly. I've used both in the past. Currently I'm using Logz.io and loving it. They have a limited free plan available as well that you can play with. It has helped me so much with my current SAAS product I'm working on. I couldn't have finished my MVP without it for sure. Thanks Logz.io!
Here's an article that may be helpful.
https://logz.io/learn/complete-guide-elk-stack/#installing-elk
It was pretty easy to get going with it when I started. Let me know if you have any questions getting this set up.
Thanks - super helpful
Mock your users' sessions (e.g. login as that user using your admin account). Logging is great, but having a way to authenticate as the user themselves and going through the process will help bugs pop up quickly.
This has helped us tremendously in the past!
Thanks - how do you do this?
Allow for a variable in your user session that defines the current session belonging to an admin.
Build a class that let's you "login as your user." So you see exactly what they see. Once you've debugged, simply log out or have a button that gives your session back to the admin.
isn't fullstory supposed to do a lot of this for you?