TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How do I debug my back end in production?

6 点作者 parthi将近 5 年前
We&#x27;re a small startup running Node for our backend. Using a combination of LogDNA, FullStory, Sentry and Mixpanel across frontend and backend.<p>Problems I face:<p>1. Can&#x27;t trace user journey: User reports a bug. I look through logs with a timestamp of the user report, but can&#x27;t trace the user journey, especially with lots of asynchronous operations going on in parallel<p>2. Insufficient logging: I can identify the error being thrown but can&#x27;t identify the cause. Would want to see logs of surrounding code which we maybe didn&#x27;t log<p>To solve this, I&#x27;ve resorted to adding logging around the suspected problem path, pushing to production and asking the user to try again (very annoying for them)<p>Any best practices I&#x27;m missing or is this really the best way to be debugging issues in prod?

2 条评论

zadkey将近 5 年前
I&#x27;m not familiar with nodejs backends specifically, but for web applications in general it should be possible to run a local copy of the web application with the same code that is being used in production and have it use the prod database connection. And then you can locally step through what is an equivalent of what is in prod with all of your normal local development tools and debuggers.<p>If you get this working, you can follow along steps to reproduce and hit debug breakpoints etc.
评论 #23399356 未加载
XCSme将近 5 年前
Do you get the stack trace of the error?
评论 #23396174 未加载