Supported Versions

Ruby and Rails

  • Ruby 3.3.0 or newer (the gemspec's required_ruby_version).
  • Rails 7.1 or newer. LogStruct depends on railties, actionpack and activesupport, not on the whole of Rails, so your app doesn't need Active Record, Active Job, Action Mailer or Active Storage.

Versions CI Tests

On every pull request and push to main, CI runs LogStruct's tests, and the integration tests of a Rails app generated with the Rails version below, on these combinations. The unit tests use Rails 8.0 in every combination; the Rails version is the generated app's.

RubyRails
3.37.1.6
3.47.2.3
3.48.0.4
4.0.18.1.2
4.0.1main (Rails' main branch)

The integration tests also run against Rails' main branch every night. Another job boots an app whose bundle has only railties and actionpack and checks that it logs a request.

Required Dependencies

Installing LogStruct installs these gems.

GemRequirementDescription
actionpack>= 7.1Rails' request handling (controllers, middleware)
activesupport>= 7.1Rails' core extensions and notifications
globalid>= 1.0Global IDs for records, used to log job arguments
lograge>= 0.11Rails' request logs as one line per request
railties>= 7.1Rails core: application boot and Railtie hooks
semantic_logger~> 4.15The logger LogStruct writes its lines with
sorbet-runtime>= 0.5Sorbet's runtime type checks, for LogStruct's typed log lines

Optional Integrations

LogStruct doesn't install these gems. When your app loads one, LogStruct logs what it does (or, for the error reporters, reports errors to it). Tested with is the version LogStruct's own test suite installs: the development dependencies in its gemspec, or what its Rails test app adds. Other versions may work, but they aren't tested.

GemTested withDescription
actionmailerThe Rails versions above (Rails test app)Rails' mailers: delivery lines and mailer errors
activejobThe Rails versions above (Rails test app)Rails' job framework: a line for each step of a job, and its errors
activerecordThe Rails versions above (Rails test app)Slow SQL query lines

Off by default: set enable_sql_logging to turn it on.

activestorageThe Rails versions above (Rails test app)Rails' file storage: uploads, downloads, deletes and other storage calls
active_model_serializers~> 0.10.13Serializing Ruby objects to JSON
ahoy_matey>= 4.1, < 6.0Analytics for Rails
bugsnag~> 6.26Error reporting
carrierwave~> 3.0File uploads
dotenv-rails~> 3.1Loads environment variables from .env files
good_jobNot installed: the tests use stand-insA Postgres-based ActiveJob backend

The ActiveJob integration logs GoodJob's jobs; this one makes GoodJob's own lines JSON and logs its thread errors, which needs GoodJob 3.0 or later.

honeybadger~> 5.4Error reporting
puma~> 7.0 (Rails test app)Web server: boot, shutdown and request error lines
rollbar~> 3.4Error reporting
sentry-ruby~> 5.15Error reporting
shrine~> 3.5File attachments
sidekiq~> 7.2Background jobs

Sidekiq 6: LogStruct keeps Sidekiq's own failed-job handler, which logs the job (with its arguments) and the error in three lines. Sidekiq 6 and 8 are untested.

How Integrations Turn On

  • Each integration runs when its gem is loaded, in the processes where LogStruct is on (see Enabling LogStruct).
  • Each one except the error reporters has an enable_* setting to turn it off. SQL query logging is off by default (enable_sql_logging).
  • Errors are reported to one service: the first of Sentry, Bugsnag, Rollbar and Honeybadger that your app loads, unless you set an error reporting handler.

The Integrations page shows what each one logs. Please open a PR if you'd like support for another gem or version.