Setup Guide

Get started sending logs to Recall in a few minutes.

1

Add the gem to your Gemfile

gem 'brainzlab-sdk'

Then run bundle install

2

Create an initializer

Create config/initializers/recall.rb

BrainzLab::Recall.configure do |config|
  config.key = ENV['RECALL_KEY']
  config.url = 'https://recall.brainzlab.ai'
end
3

Set your environment variable

Add your ingest key to your environment:

RECALL_KEY=sk_live_91696ce91ac4162d62552c04a83ba864112475e2527480590cf541e8d92f4224
4

Start logging

Use Recall anywhere in your app:

BrainzLab::Recall.info("User signed up", user_id: user.id)

BrainzLab::Recall.error("Payment failed",
  error: e.message,
  user_id: user.id,
  amount: order.total
)

One-line setup

Want all your Rails logs sent to Recall automatically? Add this to your initializer:

Rails.logger = BrainzLab::Recall.logger

Available log levels

.debug .info .warn .error .fatal

Test your integration

Send a test log with curl:

curl -X POST https://recall.brainzlab.ai/api/v1/log \
  -H "Authorization: Bearer sk_live_91696ce91ac4162d62552c04a83ba864112475e2527480590cf541e8d92f4224" \
  -H "Content-Type: application/json" \
  -d '{"level": "info", "message": "Hello from Recall!"}'