All Articles/Error Tracking

Using Stack Traces to Debug Production Errors

Read and navigate stack traces to find the root cause of errors.


Stack Trace View

The Stack Trace tab in the error detail page shows the full call stack that led to the error. Each frame shows:

  • File name and line number
  • Function name
  • Code context (surrounding lines)

Application vs. Vendor Frames

Lognitor separates stack frames into two groups:

  • Application frames — your code. Shown first and expanded by default.
  • Vendor/library frames — third-party code. Collapsed by default to reduce noise.

Focus on the topmost application frame — that's usually where the bug is.

Request Context

Below the stack trace, you'll see the HTTP request that triggered the error (if captured by middleware):

  • Method and URL
  • Status code and duration
  • IP address and user agent
  • Request headers (with sensitive values redacted)

The stack trace page also shows breadcrumbs — the trail of events leading up to the error. This gives you the full picture: what the user did, which API calls were made, and which database queries ran before the failure.

AI Analysis

Click the AI tab to get:

  • Explain — plain-language explanation of what went wrong
  • Fix — suggested code changes with diffs
  • Analyze — deep pattern analysis across occurrences