Skip to content
ErrorDock

Guide

.NET error monitoring.

Error monitoring in .NET means capturing exceptions from the runtime with enough context to diagnose them — resolved stack frames from portable PDBs, the request that triggered them, the release they came from, and the async call path reassembled into something readable.

Where exceptions surface in ASP.NET Core

Unhandled exceptions reach the request pipeline and are converted by UseExceptionHandler into a response. Monitoring middleware has to observe them before that conversion, which is why ordering in Program.cs matters more here than it looks.

Async stack traces

The raw stack trace of an async method is a sequence of state-machine frames such as MoveNext, which is close to useless. Good .NET monitoring reassembles the logical call path so the trace reads the way the code does.

Portable PDBs and symbol resolution

Frames resolve to file and line only when symbols are available. Publishing portable PDBs alongside the application, or embedding them, is what turns a trace of type and method names into one that points at a line you can open. The runtime reads them when it builds the stack trace, so they ship with the application rather than being uploaded anywhere.

  • Publish or embed portable PDBs with the application
  • Ship symbols with the exact build they describe
  • Separate application frames from framework frames
  • Reassemble async call paths

What to capture beyond the exception

Route and HTTP method, status code, correlation id, the authenticated user identifier, the environment and the release. Header and body capture should be allow-listed rather than blanket, because that is where personal data leaks into a monitoring system.

Where ErrorDock fits

ErrorDock provides .NET packages that capture exceptions with this context and add product usage from the same package. Request and query timing come from OpenTelemetry, exported to the same project.

Frequently asked questions

Should I catch exceptions or let them propagate?
Let them propagate unless you can genuinely handle them. Catching to log and rethrow adds noise; catching to swallow hides failure. A global handler plus monitoring middleware covers the general case.
Does error monitoring replace ILogger?
No. ILogger remains the right place for intentional application narrative. Monitoring captures the failures you did not plan for and aggregates them.

Related

Bring your application into focus.

Tell us about your stack. We will help define the right beta setup for your first project.