Structured logging with total memory for Rails apps.
# Install SDK
gem 'brainzlab'
# Configure
BrainzLab.configure { |c| c.recall_key = ENV['RECALL_API_KEY'] }
# Send logs
BrainzLab::Recall.info("User signed up", user: user.as_json)docker pull brainzllc/recall:latest
# or
docker pull ghcr.io/brainz-lab/recall:latest
docker run -d \
-p 3000:3000 \
-e DATABASE_URL=postgres://user:pass@host:5432/recall \
-e REDIS_URL=redis://host:6379/1 \
-e RAILS_MASTER_KEY=your-master-key \
brainzllc/recall:latest# Gemfile
gem 'brainzlab'# config/initializers/brainzlab.rb
BrainzLab.configure do |config|
config.recall_key = ENV['RECALL_API_KEY']
endgit clone https://github.com/brainz-lab/recall.git
cd recall
bundle install
bin/rails db:create db:migrate db:seed
bin/rails server| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection | Yes |
REDIS_URL |
Redis connection | Yes |
RAILS_MASTER_KEY |
Rails credentials | Yes |
BRAINZLAB_PLATFORM_URL |
Platform URL for auth | Yes |
SERVICE_KEY |
Internal service key | Yes |
- Ruby 3.4.7 / Rails 8.1
- PostgreSQL 16 with JSONB + pg_trgm
- Redis 7
- Hotwire (Turbo + Stimulus) / Tailwind CSS
- Solid Queue / Solid Cache / Solid Cable
BrainzLab::Recall.info("User signed up", user: user.as_json)
BrainzLab::Recall.error("Payment failed", error: e.message, amount: 99.99)
BrainzLab::Recall.debug("Cache hit", key: "user:123", ttl: 3600)# Text search
"payment failed"
# Field filters
level:error env:production
# Time ranges
since:1h until:now
# Nested data
data.user.id:123
# Negation
level:!debug
# Combined
level:error env:production since:24h "connection timeout"
# Aggregation
since:1h | stats by:level
| Field | Description | Example |
|---|---|---|
level |
Log level | level:error |
env |
Environment | env:production |
commit |
Git commit | commit:abc123 |
branch |
Git branch | branch:main |
service |
Service name | service:api |
request_id |
Request ID | request_id:req_xxx |
session |
Session ID | session:sess_xxx |
since |
Start time | since:1h, since:2024-01-01 |
until |
End time | until:now |
data.* |
Nested fields | data.user.email:john@example.com |
{
"level": "info",
"message": "User signed up",
"timestamp": "2024-12-21T10:00:00Z",
"data": {
"user": {
"id": "user_123",
"email": "john@example.com"
}
},
"context": {
"request_id": "req_abc123",
"session_id": "sess_xyz789",
"commit": "abc123",
"branch": "main",
"environment": "production",
"service": "api",
"host": "web-1"
}
}POST /api/v1/log- Send single logPOST /api/v1/logs- Batch send logs
GET /api/v1/logs?q=<query>- Search logsGET /api/v1/logs/:id- Get single log
POST /api/v1/sessions- Create sessionGET /api/v1/sessions/:id/logs- Get session logsDELETE /api/v1/sessions/:id- Clear session
| Tool | Description |
|---|---|
recall_query |
Query logs with DSL |
recall_errors |
Get error/fatal logs |
recall_stats |
Statistics by level/commit/hour |
recall_by_session |
All logs for a session |
recall_new_session |
Create new session ID |
recall_clear_session |
Delete session logs |
Full documentation: docs.brainzlab.ai/products/recall
services:
recall:
image: brainzllc/recall:latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://user:pass@db:5432/recall
REDIS_URL: redis://redis:6379/1
RAILS_MASTER_KEY: ${RAILS_MASTER_KEY}
BRAINZLAB_PLATFORM_URL: http://platform:3000
depends_on:
- db
- redisbin/rails test # Unit tests
bin/rails test:system # System tests
bin/rubocop # LintingSee CONTRIBUTING.md for development setup and contribution guidelines.
- brainzlab-ruby - Ruby SDK
- Reflex - Error tracking
- Pulse - APM
- Stack - Self-hosted deployment
MIT