Lograge is a Rails logging library that replaces the framework's verbose default request logging with a single-line, key-value format output.
Rails' default logging produces multiple lines per request with verbose, difficult-to-parse output that becomes unreadable when multiple processes write to the same log file in production. Lograge solves this by capturing all relevant request information—method, path, status, duration, and custom data—into a single structured line. The approach removes the noise and clutter of Rails' standard logger while preserving essential details in a format inspired by Heroku's router logs.
Lograge suits production environments where log volume and readability matter. It works well for applications running multiple processes or servers that write to shared log files, and for teams using log aggregation or parsing tools that benefit from structured output. The tool is particularly valuable if you want to move away from Rails' logging defaults without switching to external log formatters or adding request tokens. The project supports a wide range of Rails and Ruby versions, including recent releases and older versions, with official support spanning multiple major versions of both frameworks.
The project maintains active compatibility testing across supported Rails and Ruby versions in continuous integration. Development includes best-effort testing against edge versions of Rails and Ruby to catch upcoming incompatibilities early, though these are not yet officially supported. The tool provides configuration flexibility through initializers, allowing customization of output format, addition of custom data via hooks, timestamp inclusion, filtering of specific log messages, and support for alternative output formats including JSON for use with log aggregation systems.