A Ruby gem that replaces Rails' verbose default request logging with a single, structured line per request.
Lograge is a Ruby gem that replaces Rails' default verbose request logging with a single, structured line per request. It solves the problem of noisy, unparsable Rails logs in production by outputting clean key-value pairs containing essential request data like method, path, controller, action, status, and timings.
Rails developers and DevOps engineers who need clean, parseable logs for production monitoring, log aggregation, and analysis.
Developers choose Lograge because it dramatically simplifies Rails logging, making logs human-readable and machine-parseable without losing critical information, and it integrates seamlessly with existing Rails applications.
An attempt to tame Rails' default policy to log everything.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Consolidates each Rails request into one concise log line with key-value pairs, drastically improving readability and parsability in production, as shown in the README's comparison of verbose vs. structured logs.
Supports multiple output formats including JSON, Logstash, and raw Ruby hashes, enabling easy integration with log aggregation systems like ELK stack without custom parsing.
Allows adding custom data via custom_options and custom_payload lambdas, and skipping logs for specific actions, offering fine-grained control over log content based on project needs.
Extends structured logging to Action Cable events such as subscriptions and disconnects, providing comprehensive coverage for real-time features, though it requires overriding the default logger.
Removes ActionView logging and partial rendering times by default, which the README admits are better suited for metrics services, potentially hindering detailed performance debugging without extra setup.
Silences the default Action Cable logger, forcing developers to use Rails.logger in user-defined classes, which can break existing code and require refactoring, as noted in the documentation.
Does not include request parameters in logs by default, necessitating manual configuration with custom_options and careful filtering of sensitive data, adding complexity for teams needing comprehensive request tracking.