No commit activity in last 3 years
No release in over 3 years
Multiple rails instances writing to the same log cause entries to be interleaved, making them hard to ready. This command line script groups them by request, using the pid.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 5.7
~> 10.0

Runtime

~> 1.1
~> 2.1
 Project Readme

RailsLogDeinterleaver

Rails logs in production are usually written to by multiple processes. This causes the log entries for a single request to be interleaved with other requests making the logs hard to read.

This gem includes a command line script to parse the interleaved logs and output logs grouped by the request, using the pid of the server process. it acts like the tail command, and monitors a continually updating log file.

Note that I am using syslog/rails 3 so the logs will be in a slightly different format that what rails will output by default in Rails 4. But this library could be easily updated to support both.

Build Status

Install

gem install rails_log_deinterleaver

Use

rails_log_deinterleaver [options] /path/to/interleaved/railslog.log

possible options

  • -o, --output=x : Where to write the formatted log (if not specified stdout will be used)
  • -b, --backward=x : Start from the bottom of the file, x lines from the end. If not specified, the whole file will be parsed.