Monitoring apache logs with tail –f tends gets very frustrating for the eyes after a while. Are there any tool/options to colorize the log outputs? Maybe signal FATAL with red, etc...

link|improve this question
feedback

2 Answers

up vote 3 down vote accepted

I'm using multitail to monitor logs, it includes coloring as well as multiple logfile monitoring either merged or in windows. Give it a try.

link|improve this answer
feedback

Found this: http://fixunix.com/unix/83044-tail-color.html

tail -f file | perl -pe 's/keyword/\e[1;31;43m$&\e[0m/g'

This only works on ANSI terminals, but all others have become virtually extinct. \e[...m ist the ANSI escape sequence SGR "select graphic rendition". The "..." can be replaced by some semicolon-separated integers, with the meaning:

0 : all attributes off 1 : bold 31 : foreground red 43 : background yellow

"keyword", of course, can be any perl regular expression:

(foo|bar) highlight the strings foo and bar \b((foo|bar)\b highlight the words foo and bar .\b((foo|bar)\b. highlight the whole line that contains the words foo or bar

Or, the easy way, just install colortail Its probably in your favorite repo (dag for CentOS)

http://developwithstyle.com/articles/2010/04/20/tail-your-logs-with-a-touch-of-color.html

http://joakimandersson.se/projects/colortail/

link|improve this answer
Yeah, multitail is best – Grizly Sep 3 '10 at 5:25
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.