Replaces the Rails default logger with Semantic Logger for structured, JSON-formatted logging in production.
Rails Semantic Logger is a Ruby gem that replaces the default Rails logger with Semantic Logger to enable structured, JSON-formatted logging. It solves the problem of managing human-readable logs in production by making logs machine-readable, which improves parsing, searching, and alerting in centralized logging systems.
Rails developers and DevOps engineers who need robust, structured logging for production applications, especially those deployed in Kubernetes or using centralized logging systems.
Developers choose Rails Semantic Logger because it seamlessly integrates with Rails and popular gems like Sidekiq, provides out-of-the-box JSON logging for better observability, and simplifies log management in production environments without requiring complex regex parsing.
Rails Semantic Logger replaces the Rails default logger with Semantic Logger
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Outputs logs in JSON format for easy parsing by centralized systems like Observe, eliminating multi-line log issues and enabling robust queries without complex regex.
Automatically switches to JSON logging in Kubernetes based on environment detection, as shown in the config example using KUBERNETES_SERVICE_HOST.
Provides built-in logging for Sidekiq job duration and queue latency, with specific metrics like 'sidekiq.job.perform' for detailed performance dashboards.
Patches Rails and gems like Sidekiq to ensure structured logging compatibility across versions, though this relies on community updates.
Patches can break with new versions of Rails or supported gems, and the project admits reliance on community contributions for fixes, risking stability.
Requires manual setup in config files (e.g., application.rb) and environment-specific adjustments, which can be error-prone for teams new to structured logging.
Only supports specific gems like Sidekiq; new or less common libraries may lack patches, forcing custom work for structured logging integration.