DEV Community

Discussion on: How do you catch and log errors of production web apps?

vip3rousmango profile image
Al Romano

I always make sure production applications are taking advantage of whatever monitoring/logging/error tools we have available. Our technical stack is on Azure Cloud so I like setting up Application Insights and Azure Monitoring /w custom Alerts to let me know (via email/text) if something critical occurs.

My common scenarios to cover in collecting monitoring data include:

  • Ensuring that the system remains healthy.
  • Tracking the availability of the system and its component elements.
  • Maintaining performance to ensure that the throughput of the system does not degrade unexpectedly as the volume of work increases.
  • Guaranteeing that the system meets any service-level agreements (SLAs) established with customers.
  • Protecting the privacy and security of the system, users, and data.
  • Tracking the operations that are performed for auditing or regulatory purposes.
  • Monitoring the day-to-day usage of the system and spot trends that might lead to problems if they're not addressed.
  • Tracking issues that occur, from initial report through to analysis of possible causes, rectification, consequent software updates, and deployment.
  • Tracing operations and debugging software releases.

To extend that final point about debugging software, there are a few places I want alerts and logging and that's in my server/architecture layer, application layer, client layer and lastly behaviour (UI "user layer").

For the Server layer, I have something that will scrape server access logs and error logs.

If you're using Cloud hosting then I set up the tools they provide to monitor those things on the infrastructure-side.

For the application layer, I have Azure's Application Insights' Node SDK running to give me application error monitoring and I pair this with Azure Alerts again to let me know about critical issues me or the team need to know about as soon as they happen. Application Insight's flexibility lets me use it both in the back-end for node debugging and error reporting but it also has a client-side JS implementation as well with a similar feel to how Google Analytics' events. There are so many tools here in this space I suggest you try a bunch and pick what you like:, LogRocket and Rollbar are the other favourites I recommend to check out.

For the behaviour layer, I highly recommend HEAP Analytics - their user-centric data approach and UI to setup events/actions on a site is super smooth and is a valuable tool to match user behaviour and UI path and match that with error logging reports and App Insights telemetry on user path/behaviour. I find HEAP much more helpful and insightful than simply relying on Google Analytics for front-end tracking/web metrics.

darksmile92 profile image
Robin Kretzschmar Author

I really appreciate you took the time to answer do detailed!

You have some good points. I am used to have Azure available in the enterprise environment but for my own clients with relative small apps compared to my dayjob the stuff usually runs on DigitalOcean and I am searching for good ways to make the most out of it.

Besides reliablillity metrics an underestimated point is indeed to watch out for possible bottlenecks in the future with increasing transactions 👍