How can I see the colored log using tail or less? How can I see the colored log using tail or less? ruby-on-rails ruby-on-rails

How can I see the colored log using tail or less?


pass -R to less for it to let colour escape sequences pass through, i.e.

less -R log/development.log

This should result in them being displayed in colour, assuming you are using the proper terminal type


tail -f log/development.log | ccze -A

You may need to install ccze

sudo apt-get install ccze

it works better, not ideal but works


You can't do that out of the box, since tail and less know nothing about Rails, and logs are saved a simple text files. You could use regular expressions to colorize output but I doubt it's worth the trouble.

EDIT: see alfonso's comment for some alternatives.