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_21a55c7a41ee1089039fe421b79675895ecc7f2f5f789388aee4ff71e1189978
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_21a55c7a41ee1089039fe421b79675895ecc7f2f5f789388aee4ff71e1189978" \
-H "Content-Type: application/json" \
-d '{"level": "info", "message": "Hello from Recall!"}'