Skip to main content

Why do my log messages (breadcrumbs) take time to appear in Sentry?

Issue

I add breadcrumbs with addBreadcrumb to log context in my app, but they do not appear in Sentry right away. There is a long delay before my breadcrumbs (log messages) show up, and I expected them to arrive instantly.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • Error Monitoring

Resolution

Breadcrumbs and error events in Sentry behave differently:

  • Breadcrumbs (such as your addBreadcrumb calls) are not sent to Sentry immediately. The SDK collects and stores them locally at runtime and sends them only when an event occurs. They do not create an event on their own; the SDK buffers them until the next event is sent, as described in the Sentry breadcrumbs documentation.

  • Error events (such as your captureException calls) are sent when they occur, and they include any breadcrumbs collected before the error.

This is why you do not see your breadcrumbs until later: the SDK sends them only when it captures and sends an error event.

To confirm when the SDK sends events, check the debug logs.

To send a message to Sentry immediately, use Sentry.captureMessage(). If your goal is logging, follow the Sentry logging guide.

If you want to send log messages that reach Sentry directly instead of buffering them as breadcrumbs, use Sentry Structured Logs. Enable logs in your SDK and send them with the Sentry.logger API, then view, search, and filter them in Sentry alongside your errors and traces. See the setup guide for your SDK.

In summary, breadcrumbs alone do not trigger a send. The SDK sends them together with an error event, which explains the delay. For log messages you want in Sentry right away, use Sentry Logs.

Did this answer your question?