Improving Production Logging with lograge

Learn about how to enhance the production logs for our Rails application using lograge.

How are Rails logs different?

Rails application logs have colored text and appear on multiple lines. This might be nice for local development, but it wreaks havoc with most log aggregation tools we may use in production to examine our application logs. Even if we download the files and grep them, we need each logged event to be on a single line on its own.

The lograge is a gem that provides this exact feature. It requires only a short initializer in config/initializers as configuration. Let’s install the gem first:

Get hands-on with 1400+ tech skills courses.