9 avr. 2014

Color your logs

Log files are a pain to read. When colored a bit, you start having a better understanding of what it going on under the hood.

This is achieved via a simple tail replacement: colortail.

On OSX, hit the following command:
brew install colortail

On Ubuntu, use your favorite package system command:
sudo apt-get install colortail

Now, in your ~/.bashrc or your ~/.zshrc, add a simple aliases:
alias tail='colortail -k ~/.colortail/conf.default '

Create a ~/.colortail dir where you can put your colored theme files:
mkdir ~/. colortail

Here is my ~/.colortail/conf.default file:
COLOR brightred
# matches the word ERROR
COLOR yellow
# matches the word WARNING
COLOR green
# matches the word INFO
COLOR grey
# matches the word DEBUG
COLOR brightblue
# matches the time