Taming Ruby on Rails Logging with Lograge and Mezmo

LogDNA is now Mezmo but the product you know and live is here to stay
Ruby on Rails is a powerful and intuitive framework for building web applications. With its low barrier to entry, getting started is fast—but as applications grow in complexity, maintaining clear, actionable logs becomes essential for full stack monitoring.
Rails was originally designed when applications lived on a single server. Every interaction—loading a page, submitting a form—generates multiple verbose log entries, often across several lines, making it difficult to track a single user’s request or pinpoint failures.
Here’s a typical log sample for one simple action:
While manageable for small applications, this log fragmentation becomes problematic at scale, especially in containerized and serverless environments. Add in distributed systems, and parsing these scattered lines manually becomes nearly impossible.
That’s where Lograge enters the picture, bringing structure and clarity for teams managing complex telemetry pipelines.
In response to Rails' noisy logging, Mathias Meyer developed Lograge—a tool built to streamline Rails logs into structured, machine-parseable, single-line outputs. The result? Logs that are compact and highly usable in any telemetry pipeline.
Here’s what the example log looks like after applying Lograge:
This structure helps platforms like Mezmo ingest logs cleanly for APM logs, visualization, and correlation with traces and metrics, enabling deep application insight.
With structured logs enriched like this, Mezmo users benefit from enhanced traceability and the ability to feed detailed APM logs into dashboards and alerts.
To get the additional custom variables in the event payload you must add them to your controller. For instance, we could do something like
Since Meyer designed Lograge to integrate naturally with Ruby's built-in logging, we can use Mezmo's own Ruby/Rails logger to ingest logs from your application. In two short steps, you can have your entire application sending logs to Mezmo.
Step One: Include the logdna gem
Step Two: Configure the Rails logger to use Mezmo with JSON-formatted Lograge
And with that, your logs are both concise and aggregated, allowing you to monitor and troubleshoot your Rails app faster.
Pro Tip
Mezmo displays the message field as the human-readable headline of any log entry, making it easy to scan logs in the viewer. All other fields remain fully searchable and usable for filtering, alerting, and dashboarding.
Want to see this in action? Check out our GitHub guide to building a Rails decoder app with Lograge + Mezmo or contact one of our logging experts.
Join the Mezmo community, explore our docs, and level up your full stack monitoring today.