Log Context
Context allows you to attach metadata to all logs within a specific scope, without passing it to every log call.Global Context
Set context that applies to all logs:User Context
Set the current user:Request Context
Automatically captured in Rails:request_id- The Rails request IDpath- The request pathmethod- HTTP methodcontroller- Controller nameaction- Action nameformat- Response format
Block-Scoped Context
Add context for a specific block:Tags
Tags are indexed for fast filtering:Environment Variables
Automatically captured:| Variable | Description |
|---|---|
RAILS_ENV | Rails environment |
GIT_COMMIT | Git commit SHA |
GIT_BRANCH | Git branch name |
DYNO | Heroku dyno name |
HOSTNAME | Server hostname |