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,actionpackandactivesupport, 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.
| Ruby | Rails |
|---|---|
| 3.3 | 7.1.6 |
| 3.4 | 7.2.3 |
| 3.4 | 8.0.4 |
| 4.0.1 | 8.1.2 |
| 4.0.1 | main (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.
| Gem | Requirement | Description |
|---|---|---|
| actionpack | >= 7.1 | Rails' request handling (controllers, middleware) |
| activesupport | >= 7.1 | Rails' core extensions and notifications |
| globalid | >= 1.0 | Global IDs for records, used to log job arguments |
| lograge | >= 0.11 | Rails' request logs as one line per request |
| railties | >= 7.1 | Rails core: application boot and Railtie hooks |
| semantic_logger | ~> 4.15 | The logger LogStruct writes its lines with |
| sorbet-runtime | >= 0.5 | Sorbet'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.
| Gem | Tested with | Description |
|---|---|---|
| actionmailer | The Rails versions above (Rails test app) | Rails' mailers: delivery lines and mailer errors |
| activejob | The Rails versions above (Rails test app) | Rails' job framework: a line for each step of a job, and its errors |
| activerecord | The Rails versions above (Rails test app) | Slow SQL query lines Off by default: set enable_sql_logging to turn it on. |
| activestorage | The Rails versions above (Rails test app) | Rails' file storage: uploads, downloads, deletes and other storage calls |
| active_model_serializers | ~> 0.10.13 | Serializing Ruby objects to JSON |
| ahoy_matey | >= 4.1, < 6.0 | Analytics for Rails |
| bugsnag | ~> 6.26 | Error reporting |
| carrierwave | ~> 3.0 | File uploads |
| dotenv-rails | ~> 3.1 | Loads environment variables from .env files |
| good_job | Not installed: the tests use stand-ins | A 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.4 | Error reporting |
| puma | ~> 7.0 (Rails test app) | Web server: boot, shutdown and request error lines |
| rollbar | ~> 3.4 | Error reporting |
| sentry-ruby | ~> 5.15 | Error reporting |
| shrine | ~> 3.5 | File attachments |
| sidekiq | ~> 7.2 | Background 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.