(New in version 1.2.)

Breadcrumbs are a trail of events which happened prior to an issue. Often, these events are very similar to traditional logs, but Breadcrumbs also can record rich, structured data.

Raven.breadcrumbs.record do |crumb| = data
  crumb.category = name
  # ...

The following attributes are available:

  • category: A String to label the event under. This will usually be the same as a logger name, and will let you more easily understand the area an event took place, such as “auth”.
  • data: A Hash of metadata around the event. This is often used instead of message, but may also be used in addition.
  • level: The level may be any of error, warn, info, or debug.
  • message: A string describing the event. The most common vector, often used as a drop-in for a traditional log message.
  • timestamp: A Unix timestamp (seconds past epoch)

Appropriate places to inject Breadcrumbs may be places like your HTTP library:

# Instrumenting Faraday with a middleware:

class RavenFaradayMiddleware
  def call
    # Add a breadcrumb every time we complete an HTTP request do |response_env|
      Raven.breadcrumbs.record do |crumb| = { response_env: response_env }
        crumb.category = "faraday"
        crumb.timestamp =
        crumb.message = "Completed request to #{request_env[:url]}"

(New in version 2.6.)

The breadcrumb buffer is publicly accessible if you wish to manipulate it beyond what is possible with the record method.

Raven.breadcrumbs.buffer # Array of breadcrumbs
On this page