LogStruct is a JSON structured logging gem for Ruby on Rails. Its goal is to turn Rails application logs into structured output that is easy to search, filter, and visualize with βzero configuration.β By default, it enables JSON logs in production and test environments, and sends logs to STDOUT or a configured destination, making it suitable for integration with logging and monitoring systems such as CloudWatch, Grafana, and Datadog.
In terms of functionality, LogStruct is more than just a request log formatter. It uses Lograge for structured request logging and Semantic Logger as its logging framework, covering common Rails components such as ActiveJob, ActionMailer, Sidekiq, GoodJob, Shrine, CarrierWave, ActiveStorage, SQL, and Puma. On the security side, it supports parameter filtering and string redaction, handling sensitive data such as emails, credit cards, passwords, IPs, SSNs, phone numbers, and URL passwords. It can also log security events such as CSRF, IP spoofing, and blocked hosts.
Type safety is one of its differentiators. The project is 100% Sorbet typed, with built-in log structures that support type checking, as well as custom typed logs. However, users do not need to use Sorbet in their own projects; they can still log strings or hashes directly via Rails.logger.
The documentation clearly states that LogStruct is completely free and open source under the MIT License. The current RubyGems version is listed as 0.1.12. It is a library installed inside a Rails application rather than a hosted SaaS product, so there are no cloud subscriptions, seat fees, or payment details involved.
Its strengths include simple installation, broad integration across the Rails ecosystem, production-oriented defaults, detailed redaction capabilities, and integrations with error reporting tools such as Sentry, Bugsnag, Rollbar, and Honeybadger, plus Terraform types. The documentation is also fairly systematic, covering configuration, integrations, SOC 2, YARD API references, and comparison pages.
The limitations are also clear: its scope is centered on Rails >= 7.1, so it has limited value for non-Rails projects; sorbet-runtime is a dependency; and the project is still at an early version, with no commercial support or SLA mentioned in the documentation.
LogStruct is best suited to teams building Rails observability, requiring SOC 2 audit logs, sensitive data redaction, and unified DevOps logging standards. Access from China is not discussed in the documentation. GitHub, RubyGems, and cloud logging platforms may perform inconsistently in mainland network environments, so users should verify access themselves. Alternatives include Rails Semantic Logger, Lograge, Logstasher, and Logcraft.
β This review is compiled from public sources and does not constitute a purchase recommendation. Verify all facts on the vendor's official site. Verify on logstruct.com official site.
logstruct.com is an United States Dev Tools provider. TG4G tracks its product information, an overall rating of 7.0/10, and a China-accessibility score of China direct-connect friendly. Click "Visit Official Site" to reach logstruct.com directly.